ParagonIE_Sodium_Core_Ed25519::sign_open

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core_Ed25519::sign_open( string $message, string $pk )

Parameters Parameters

$message

(string) (Required) A signed message

$pk

(string) (Required) Public key

Return Return

(string) Message (without signature)

Source Source

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

    public static function sign_open($message, $pk)
    {
        /** @var string $signature */
        $signature = self::substr($message, 0, 64);

        /** @var string $message */
        $message = self::substr($message, 64);

        if (self::verify_detached($signature, $message, $pk)) {
            return $message;
        }
        throw new SodiumException('Invalid signature');
    }

Advertisement

Advertisement

Leave a Reply

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