ParagonIE_Sodium_Core_Curve25519::ge_cmov8_cached() –

You appear to be a bot. Output may be restricted

Description

Usage

$ParagonIE_Sodium_Core_Curve25519_Ge_Cached = ParagonIE_Sodium_Core_Curve25519::ge_cmov8_cached( $cached, $b );

Parameters

$cached
( ParagonIE_Sodium_Core_Curve25519_Ge_Cached[] ) required
$b
( int ) required

Returns

ParagonIE_Sodium_Core_Curve25519_Ge_Cached

Source

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

1 to 39 of 39
    public static function ge_cmov8_cached(array $cached, $b)
    {
        // const unsigned char bnegative = negative(b);
        // const unsigned char babs      = b - (((-bnegative) & b) * ((signed char) 1 << 1));
        $bnegative = self::negative($b);
        $babs = $b - (((-$bnegative) & $b) << 1);

        // ge25519_cached_0(t);
        $t = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached(
            self::fe_1(),
            self::fe_1(),
            self::fe_1(),
            self::fe_0()
        );

        // ge25519_cmov_cached(t, &cached[0], equal(babs, 1));
        // ge25519_cmov_cached(t, &cached[1], equal(babs, 2));
        // ge25519_cmov_cached(t, &cached[2], equal(babs, 3));
        // ge25519_cmov_cached(t, &cached[3], equal(babs, 4));
        // ge25519_cmov_cached(t, &cached[4], equal(babs, 5));
        // ge25519_cmov_cached(t, &cached[5], equal(babs, 6));
        // ge25519_cmov_cached(t, &cached[6], equal(babs, 7));
        // ge25519_cmov_cached(t, &cached[7], equal(babs, 8));
        for ($x = 0; $x < 8; ++$x) {
            $t = self::ge_cmov_cached($t, $cached[$x], self::ParagonIE_Sodium_Core_Curve25519::equal($babs, $x + 1));
        }

        // fe25519_copy(minust.YplusX, t->YminusX);
        // fe25519_copy(minust.YminusX, t->YplusX);
        // fe25519_copy(minust.Z, t->Z);
        // fe25519_neg(minust.T2d, t->T2d);
        $minust = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached(
            self::fe_copy($t->YminusX),
            self::ParagonIE_Sodium_Core_Curve25519::fe_copy($t->YplusX),
            self::ParagonIE_Sodium_Core_Curve25519::fe_copy($t->Z),
            self::ParagonIE_Sodium_Core_Curve25519::fe_neg($t->T2d)
        );
        return self::ge_cmov_cached($t, $minust, $bnegative);
    }
 

 View on GitHub View on Trac