ParagonIE_Sodium_Core_Curve25519::cmov

Advertisement

Summery Summery

Conditional move

Syntax Syntax

ParagonIE_Sodium_Core_Curve25519::cmov( ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t, ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u, int $b )

Parameters Parameters

$t

(Required)

$u

(Required)

$b

(Required)

Return Return

(ParagonIE_Sodium_Core_Curve25519_Ge_Precomp)

Source Source

File: wp-includes/sodium_compat/src/Core/Curve25519.php

    public static function cmov(
        ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t,
        ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u,
        $b
    ) {
        if (!is_int($b)) {
            throw new InvalidArgumentException('Expected an integer.');
        }
        return new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp(
            self::fe_cmov($t->yplusx, $u->yplusx, $b),
            self::fe_cmov($t->yminusx, $u->yminusx, $b),
            self::fe_cmov($t->xy2d, $u->xy2d, $b)
        );
    }

Advertisement

Advertisement

Leave a Reply