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

(ParagonIE_Sodium_Core_Curve25519_Ge_Precomp) (Required)

$u

(ParagonIE_Sodium_Core_Curve25519_Ge_Precomp) (Required)

$b

(int) (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

This site uses Akismet to reduce spam. Learn how your comment data is processed.