public static function ParagonIE_Sodium_Core32_Ed25519::sign_open in Automatic Updates 8
Same name and namespace in other branches
- 7 vendor/paragonie/sodium_compat/src/Core32/Ed25519.php \ParagonIE_Sodium_Core32_Ed25519::sign_open()
@internal You should not use this directly from another application
Parameters
string $message A signed message:
string $pk Public key:
Return value
string Message (without signature)
Throws
SodiumException
TypeError
1 call to ParagonIE_Sodium_Core32_Ed25519::sign_open()
- ParagonIE_Sodium_Crypto32::sign_open in vendor/
paragonie/ sodium_compat/ src/ Crypto32.php - Opens a signed message. If valid, returns the message.
File
- vendor/
paragonie/ sodium_compat/ src/ Core32/ Ed25519.php, line 188
Class
- ParagonIE_Sodium_Core32_Ed25519
- Class ParagonIE_Sodium_Core32_Ed25519
Code
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');
}