WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core32_Curve25519::fe_cmov() public WP 1.0

Constant-time conditional move.

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

No Hooks.

Return

ParagonIE_Sodium_Core32_Curve25519_Fe.

Usage

$result = ParagonIE_Sodium_Core32_Curve25519::fe_cmov(;

Code of ParagonIE_Sodium_Core32_Curve25519::fe_cmov() WP 5.8.2

public static function fe_cmov(
    ParagonIE_Sodium_Core32_Curve25519_Fe $f,
    ParagonIE_Sodium_Core32_Curve25519_Fe $g,
    $b = 0
) {
    /** @var array<int, ParagonIE_Sodium_Core32_Int32> $h */
    $h = array();
    for ($i = 0; $i < 10; ++$i) {
        if (!($f[$i] instanceof ParagonIE_Sodium_Core32_Int32)) {
            throw new TypeError('Expected Int32');
        }
        if (!($g[$i] instanceof ParagonIE_Sodium_Core32_Int32)) {
            throw new TypeError('Expected Int32');
        }
        $h[$i] = $f[$i]->xorInt32(
            $f[$i]->xorInt32($g[$i])->mask($b)
        );
    }
    /** @var array<int, ParagonIE_Sodium_Core32_Int32> $h */
    return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($h);
}