WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255() public WP 1.0

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

No Hooks.

Return

String.

Usage

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

Code of ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255() WP 5.8.2

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;
}