WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core_Ristretto255::ristretto255_from_hash() 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::ristretto255_from_hash( $h );
$h(string) (required)
-

Code of ParagonIE_Sodium_Core_Ristretto255::ristretto255_from_hash() WP 5.8.2

public static function ristretto255_from_hash($h)
{
    if (self::strlen($h) !== 64) {
        throw new SodiumException('Hash must be 64 bytes');
    }
    //fe25519_frombytes(r0, h);
    //fe25519_frombytes(r1, h + 32);
    $r0 = self::fe_frombytes(self::substr($h, 0, 32));
    $r1 = self::fe_frombytes(self::substr($h, 32, 32));

    //ristretto255_elligator(&p0, r0);
    //ristretto255_elligator(&p1, r1);
    $p0 = self::ristretto255_elligator($r0);
    $p1 = self::ristretto255_elligator($r1);

    //ge25519_p3_to_cached(&p1_cached, &p1);
    //ge25519_add_cached(&p_p1p1, &p0, &p1_cached);
    $p_p1p1 = self::ge_add(
        $p0,
        self::ge_p3_to_cached($p1)
    );

    //ge25519_p1p1_to_p3(&p, &p_p1p1);
    //ristretto255_p3_tobytes(s, &p);
    return self::ristretto255_p3_tobytes(
        self::ge_p1p1_to_p3($p_p1p1)
    );
}