ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255() –

You appear to be a bot. Output may be restricted

Description

Usage

$string = ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255( $n, $p );

Parameters

$n
( string ) required
$p
( string ) required

Returns

string

Source

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


Lines:

1 to 24 of 24
    public static function scalarmult_ristretto255($n, $p)
    {
        if (self::strlen($n) !== 32) {
            throw new SodiumException('Scalar must be 32 bytes, ' . self::strlen($p) . ' given.');
        }
        if (self::strlen($p) !== 32) {
            throw new SodiumException('Point must be 32 bytes, ' . self::strlen($p) . ' given.');
        }
        $result = self::ristretto255_frombytes($p);
        if ($result['res'] !== 0) {
            throw new SodiumException('Could not multiply points');
        }
        $P = $result['h'];

        $t = self::stringToIntArray($n);
        $t[31] &= 0x7f;
        $Q = self::ge_scalarmult(self::intArrayToString($t), $P);
        $q = self::ristretto255_p3_tobytes($Q);
        if (ParagonIE_Sodium_Compat::is_zero($q)) {
            throw new SodiumException('An unknown error has occurred');
        }
        return $q;
    }
 

 View on GitHub View on Trac