ParagonIE_Sodium_Crypto::scalarmult_throw_if_zero() protected WP 1.0
This throws an Error if a zero public key was passed to the function.
{} Это метод класса: ParagonIE_Sodium_Crypto{}
Хуков нет.
Возвращает
null
. Null. Ничего.
Использование
$result = ParagonIE_Sodium_Crypto::scalarmult_throw_if_zero( $q );
- $q(строка) (обязательный)
- -
Код ParagonIE_Sodium_Crypto::scalarmult_throw_if_zero() ParagonIE Sodium Crypto::scalarmult throw if zero WP 5.7
protected static function scalarmult_throw_if_zero($q)
{
$d = 0;
for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) {
$d |= ParagonIE_Sodium_Core_Util::chrToInt($q[$i]);
}
/* branch-free variant of === 0 */
if (-(1 & (($d - 1) >> 8))) {
throw new SodiumException('Zero public key is not allowed');
}
}