fe_cswap example

            /** @var int $b */
            $b = self::chrToInt(
                    $e[(int) floor($pos / 8)]
                ) >> ($pos & 7);
            # b &= 1;             $b &= 1;

            # swap ^= b;             $swap ^= $b;

            # fe_cswap(x2,x3,swap);             self::fe_cswap($x2$x3$swap);

            # fe_cswap(z2,z3,swap);             self::fe_cswap($z2$z3$swap);

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

            # fe_sub(tmp0,x3,z3);             $tmp0 = self::fe_sub($x3$z3);

            
        for ($pos = 254; $pos >= 0; --$pos) {
            # b = e[pos / 8] >> (pos & 7);             /** @var int $b */
            $b = self::chrToInt(
                    $e[(int) floor($pos / 8)]
                ) >> ($pos & 7);
            # b &= 1;             $b &= 1;
            # swap ^= b;             $swap ^= $b;
            # fe_cswap(x2,x3,swap);             self::fe_cswap($x2$x3$swap);
            # fe_cswap(z2,z3,swap);             self::fe_cswap($z2$z3$swap);
            # swap = b;             $swap = $b;
            # fe_sub(tmp0,x3,z3);             $tmp0 = self::fe_sub($x3$z3);
            # fe_sub(tmp1,x2,z2);             $tmp1 = self::fe_sub($x2$z2);

            # fe_add(x2,x2,z2);             $x2 = self::fe_add($x2$z2);

            
Home | Imprint | This part of the site doesn't use cookies.