WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Compat::ristretto255_is_valid_point() public WP 1.0

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

No Hooks.

Return

true|false.

Usage

$result = ParagonIE_Sodium_Compat::ristretto255_is_valid_point( $p, $dontFallback );
$p(string) (required)
-
$dontFallback *(true false)*

Default: false

Code of ParagonIE_Sodium_Compat::ristretto255_is_valid_point() WP 5.8.2

public static function ristretto255_is_valid_point($p, $dontFallback = false)
{
    if (self::useNewSodiumAPI() && !$dontFallback) {
        return sodium_crypto_core_ristretto255_is_valid_point($p);
    }
    try {
        $r = ParagonIE_Sodium_Core_Ristretto255::ristretto255_frombytes($p);
        return $r['res'] === 0 &&
            ParagonIE_Sodium_Core_Ristretto255::ristretto255_point_is_canonical($p) === 1;
    } catch (SodiumException $ex) {
        if ($ex->getMessage() === 'S is not canonical') {
            return false;
        }
        throw $ex;
    }
}