WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Compat::crypto_scalarmult_base() public WP 1.0

Calculate an X25519 public key from an X25519 secret key.

{} It's a method of the class: ParagonIE_Sodium_Compat{}

No Hooks.

Return

String.

Usage

$result = ParagonIE_Sodium_Compat::crypto_scalarmult_base( $secretKey );
$secretKey(string) (required)
-

Code of ParagonIE_Sodium_Compat::crypto_scalarmult_base() WP 5.8.2

public static function crypto_scalarmult_base($secretKey)
{
    /* Type checks: */
    ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1);

    /* Input validation: */
    if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) {
        throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.');
    }

    if (self::useNewSodiumAPI()) {
        return sodium_crypto_scalarmult_base($secretKey);
    }
    if (self::use_fallback('crypto_scalarmult_base')) {
        return (string) call_user_func('\\Sodium\\crypto_scalarmult_base', $secretKey);
    }
    if (ParagonIE_Sodium_Core_Util::hashEquals($secretKey, str_repeat("\0", self::CRYPTO_BOX_SECRETKEYBYTES))) {
        throw new SodiumException('Zero secret key is not allowed');
    }
    if (PHP_INT_SIZE === 4) {
        return ParagonIE_Sodium_Crypto32::scalarmult_base($secretKey);
    }
    return ParagonIE_Sodium_Crypto::scalarmult_base($secretKey);
}