ParagonIE_Sodium_Core_Ristretto255::ristretto255_point_is_canonical() –

You appear to be a bot. Output may be restricted

Description

Usage

$int = ParagonIE_Sodium_Core_Ristretto255::ristretto255_point_is_canonical( $s );

Parameters

$s
( string ) required

Returns

int

Source

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


Lines:

1 to 13 of 13
    public static function ristretto255_point_is_canonical($s)
    {
        $c = (self::chrToInt($s[31]) & 0x7f) ^ 0x7f;
        for ($i = 30; $i > 0; --$i) {
            $c |= self::chrToInt($s[$i]) ^ 0xff;
        }
        $c = ($c - 1) >> 8;
        $d = (0xed - 1 - self::chrToInt($s[0])) >> 8;
        $e = self::chrToInt($s[31]) >> 7;

        return 1 - ((($c & $d) | $e | self::chrToInt($s[0])) & 1);
    }
 

 View on GitHub View on Trac