ParagonIE_Sodium_Core32_Ed25519::sign_open

Advertisement

Syntax Syntax

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

Parameters Parameters

$message

(Required) A signed message

$pk

(Required) Public key

Return Return

(string) Message (without signature)

Source Source

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