WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core_Ristretto255::fe_iszero() public WP 1.0

Returns 0 if this field element results in all NUL bytes.

{} It's a method of the class: ParagonIE_Sodium_Core_Ristretto255{}

No Hooks.

Return

Int.

Usage

$result = ParagonIE_Sodium_Core_Ristretto255::fe_iszero( $f );
$f(ParagonIE_Sodium_Core_Curve25519_Fe) (required)
-

Code of ParagonIE_Sodium_Core_Ristretto255::fe_iszero() WP 5.8.2

public static function fe_iszero(ParagonIE_Sodium_Core_Curve25519_Fe $f)
{
    static $zero;
    if ($zero === null) {
        $zero = str_repeat("\x00", 32);
    }
    /** @var string $zero */
    $str = self::fe_tobytes($f);

    $d = 0;
    for ($i = 0; $i < 32; ++$i) {
        $d |= self::chrToInt($str[$i]);
    }
    return (($d - 1) >> 31) & 1;
}