ristretto255_sqrt_ratio_m1 example

$v = self::fe_mul(
            ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d),
            $u1u1
        ); /* v = d*u1^2 */
        $v = self::fe_neg($v); /* v = -d*u1^2 */
        $v = self::fe_sub($v$u2u2); /* v = -(d*u1^2)-u2^2 */
        $v_u2u2 = self::fe_mul($v$u2u2); /* v_u2u2 = v*u2^2 */

        // fe25519_1(one);         // notsquare = ristretto255_sqrt_ratio_m1(inv_sqrt, one, v_u2u2);         $one = self::fe_1();
        $result = self::ristretto255_sqrt_ratio_m1($one$v_u2u2);
        $inv_sqrt = $result['x'];
        $notsquare = $result['nonsquare'];

        $h = new ParagonIE_Sodium_Core_Curve25519_Ge_P3();

        $h->X = self::fe_mul($inv_sqrt$u2);
        $h->Y = self::fe_mul(self::fe_mul($inv_sqrt$h->X)$v);

        $h->X = self::fe_mul($h->X, $s_);
        $h->X = self::fe_abs(
            self::fe_add($h->X, $h->X)
        );
Home | Imprint | This part of the site doesn't use cookies.