fe_0 example


        # e[31] &= 127;         # e[31] |= 64;         $e[31] = self::intToChr(
            (self::chrToInt($e[31]) & 127) | 64
        );
        # fe_frombytes(x1,p);         $x1 = self::fe_frombytes($p);
        # fe_1(x2);         $x2 = self::fe_1();
        # fe_0(z2);         $z2 = self::fe_0();
        # fe_copy(x3,x1);         $x3 = self::fe_copy($x1);
        # fe_1(z3);         $z3 = self::fe_1();

        # swap = 0;         /** @var int $swap */
        $swap = 0;

        # for (pos = 254;pos >= 0;--pos) {         for ($pos = 254; $pos >= 0; --$pos) {
            
ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[7]),
                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[8]),
                    ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[9])
                )
            );
        }
        /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */

        # fe_frombytes(h->Y,s);         # fe_1(h->Z);         $h = new ParagonIE_Sodium_Core32_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_Core32_Curve25519_Fe $d */
        $v = self::fe_mul($u$d);
        

    public function __construct(
        ParagonIE_Sodium_Core32_Curve25519_Fe $yplusx = null,
        ParagonIE_Sodium_Core32_Curve25519_Fe $yminusx = null,
        ParagonIE_Sodium_Core32_Curve25519_Fe $xy2d = null
    ) {
        if ($yplusx === null) {
            $yplusx = ParagonIE_Sodium_Core32_Curve25519::fe_0();
        }
        $this->yplusx = $yplusx;
        if ($yminusx === null) {
            $yminusx = ParagonIE_Sodium_Core32_Curve25519::fe_0();
        }
        $this->yminusx = $yminusx;
        if ($xy2d === null) {
            $xy2d = ParagonIE_Sodium_Core32_Curve25519::fe_0();
        }
        $this->xy2d = $xy2d;
    }
}

    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 */
        $v = self::fe_mul($u$d);
        

    public function __construct(
        ParagonIE_Sodium_Core32_Curve25519_Fe $x = null,
        ParagonIE_Sodium_Core32_Curve25519_Fe $y = null,
        ParagonIE_Sodium_Core32_Curve25519_Fe $z = null,
        ParagonIE_Sodium_Core32_Curve25519_Fe $t = null
    ) {
        if ($x === null) {
            $x = ParagonIE_Sodium_Core32_Curve25519::fe_0();
        }
        $this->X = $x;
        if ($y === null) {
            $y = ParagonIE_Sodium_Core32_Curve25519::fe_0();
        }
        $this->Y = $y;
        if ($z === null) {
            $z = ParagonIE_Sodium_Core32_Curve25519::fe_0();
        }
        $this->Z = $z;
        if ($t === null) {
            

        # e[31] &= 127;         # e[31] |= 64;         $e[31] = self::intToChr(
            (self::chrToInt($e[31]) & 127) | 64
        );
        # fe_frombytes(x1,p);         $x1 = self::fe_frombytes($p);
        # fe_1(x2);         $x2 = self::fe_1();
        # fe_0(z2);         $z2 = self::fe_0();
        # fe_copy(x3,x1);         $x3 = self::fe_copy($x1);
        # fe_1(z3);         $z3 = self::fe_1();

        # swap = 0;         /** @var int $swap */
        $swap = 0;

        # for (pos = 254;pos >= 0;--pos) {         for ($pos = 254; $pos >= 0; --$pos) {
            
Home | Imprint | This part of the site doesn't use cookies.