ParagonIE_Sodium_Core_Ed25519::publickey_from_secretkey

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core_Ed25519::publickey_from_secretkey( string $sk )

Parameters Parameters

$sk

(Required)

Return Return

(string)

Source Source

File: wp-includes/sodium_compat/src/Core/Ed25519.php

    public static function publickey_from_secretkey($sk)
    {
        /** @var string $sk */
        $sk = hash('sha512', self::substr($sk, 0, 32), true);
        $sk[0] = self::intToChr(
            self::chrToInt($sk[0]) & 248
        );
        $sk[31] = self::intToChr(
            (self::chrToInt($sk[31]) & 63) | 64
        );
        return self::sk_to_pk($sk);
    }

Advertisement

Advertisement

Leave a Reply