ParagonIE_Sodium_Core_Curve25519_Ge_P3 example

$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)
        );
        $h->Y = self::fe_mul($u1$h->Y);
        $h->Z = self::fe_1();
        $h->T = self::fe_mul($h->X, $h->Y);

        

    public static function ge_frombytes_negate_vartime($s)
    {
        static $d = null;
        if (!$d) {
            $d = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d);
        }

        # fe_frombytes(h->Y,s);         # fe_1(h->Z);         $h = new ParagonIE_Sodium_Core_Curve25519_Ge_P3(
            self::fe_0(),
            self::fe_frombytes($s),
            self::fe_1()
        );

        # fe_sq(u,h->Y);         # fe_mul(v,u,d);         # fe_sub(u,u,h->Z); /* u = y^2-1 */         # fe_add(v,v,h->Z); /* v = dy^2+1 */         $u = self::fe_sq($h->Y);
        /** @var ParagonIE_Sodium_Core_Curve25519_Fe $d */
        
Home | Imprint | This part of the site doesn't use cookies.