WordPress at a glance
function is not described

ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey() public WP 1.0

Calculate the X25519 public key from a given X25519 secret key.

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

No Hooks.

Return

String. The corresponding X25519 public key

Usage

$result = ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey( $secretKey );
$secretKey(string) (required)
Any X25519 secret key

Code of ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey() WP 5.7.1

<?php
public static function crypto_box_publickey_from_secretkey($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 (string) sodium_crypto_box_publickey_from_secretkey($secretKey);
    }
    if (self::use_fallback('crypto_box_publickey_from_secretkey')) {
        return (string) call_user_func('\\Sodium\\crypto_box_publickey_from_secretkey', $secretKey);
    }
    if (PHP_INT_SIZE === 4) {
        return ParagonIE_Sodium_Crypto32::box_publickey_from_secretkey($secretKey);
    }
    return ParagonIE_Sodium_Crypto::box_publickey_from_secretkey($secretKey);
}