ParagonIE_Sodium_Core_Ristretto255::fe_iszero() – Returns 0 if this field element results in all NUL bytes.

You appear to be a bot. Output may be restricted

Description

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

Usage

$int = ParagonIE_Sodium_Core_Ristretto255::fe_iszero( $f );

Parameters

$f
( ParagonIE_Sodium_Core_Curve25519_Fe ) required

Returns

int

Source

File name: wordpress/wp-includes/sodium_compat/src/Core/Ristretto255.php


Lines:

1 to 17 of 17
    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;
    }
 

 View on GitHub View on Trac