WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

ParagonIE_Sodium_Core_Ed25519::verify_detached() WP 1.0

Это метод класса: ParagonIE_Sodium_Core_Ed25519

Хуков нет.

Возвращает

true/false.

Использование

$var = ParagonIE_Sodium_Core_Ed25519::verify_detached( $sig, $message, $pk );
$sig(строка) (обязательный)
$message(строка) (обязательный)
$pk(строка) (обязательный)

Код ParagonIE Sodium Core Ed25519::verify detached: wp-includes/sodium_compat/src/Core/Ed25519.php WP 5.2.2

<?php
public static function verify_detached($sig, $message, $pk)
{
    if (self::strlen($sig) < 64) {
        throw new SodiumException('Signature is too short');
    }
    if (self::check_S_lt_L(self::substr($sig, 32, 32))) {
        throw new SodiumException('S < L - Invalid signature');
    }
    if (self::small_order($sig)) {
        throw new SodiumException('Signature is on too small of an order');
    }
    if ((self::chrToInt($sig[63]) & 224) !== 0) {
        throw new SodiumException('Invalid signature');
    }
    $d = 0;
    for ($i = 0; $i < 32; ++$i) {
        $d |= self::chrToInt($pk[$i]);
    }
    if ($d === 0) {
        throw new SodiumException('All zero public key');
    }

    /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */
    $orig = ParagonIE_Sodium_Compat::$fastMult;

    // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification.
    ParagonIE_Sodium_Compat::$fastMult = true;

    /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */
    $A = self::ge_frombytes_negate_vartime($pk);

    /** @var string $hDigest */
    $hDigest = hash(
        'sha512',
        self::substr($sig, 0, 32) .
            self::substr($pk, 0, 32) .
            $message,
        true
    );

    /** @var string $h */
    $h = self::sc_reduce($hDigest) . self::substr($hDigest, 32);

    /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */
    $R = self::ge_double_scalarmult_vartime(
        $h,
        $A,
        self::substr($sig, 32)
    );

    /** @var string $rcheck */
    $rcheck = self::ge_tobytes($R);

    // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before.
    ParagonIE_Sodium_Compat::$fastMult = $orig;

    return self::verify_32($rcheck, self::substr($sig, 0, 32));
}