ParagonIE_Sodium_Core32_Ed25519::publickey_from_secretkey

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core32_Ed25519::publickey_from_secretkey( string $sk )

Parameters Parameters

$sk

(string) (Required)

Return Return

(string)

Source Source

File: wp-includes/sodium_compat/src/Core32/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

This site uses Akismet to reduce spam. Learn how your comment data is processed.