You are here

public static function ParagonIE_Sodium_Compat::crypto_box_seed_keypair in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Compat.php \ParagonIE_Sodium_Compat::crypto_box_seed_keypair()

Generate an X25519 keypair from a seed.

@psalm-suppress MixedArgument @psalm-suppress UndefinedFunction

Parameters

string $seed:

Return value

string

Throws

SodiumException

TypeError

1 call to ParagonIE_Sodium_Compat::crypto_box_seed_keypair()
php72compat.php in vendor/paragonie/sodium_compat/lib/php72compat.php

File

vendor/paragonie/sodium_compat/src/Compat.php, line 1366

Class

ParagonIE_Sodium_Compat

Code

public static function crypto_box_seed_keypair($seed) {

  /* Type checks: */
  ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1);
  if (self::useNewSodiumAPI()) {
    return (string) sodium_crypto_box_seed_keypair($seed);
  }
  if (self::use_fallback('crypto_box_seed_keypair')) {
    return (string) call_user_func('\\Sodium\\crypto_box_seed_keypair', $seed);
  }
  if (PHP_INT_SIZE === 4) {
    return ParagonIE_Sodium_Crypto32::box_seed_keypair($seed);
  }
  return ParagonIE_Sodium_Crypto::box_seed_keypair($seed);
}