xorInt64 example

/** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Int64 $x * @param ParagonIE_Sodium_Core32_Int64 $y * @return ParagonIE_Sodium_Core32_Int64 * @throws TypeError */
    public static function xor64(ParagonIE_Sodium_Core32_Int64 $x, ParagonIE_Sodium_Core32_Int64 $y)
    {
        return $x->xorInt64($y);
    }

    /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Int64 $x * @param int $c * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */
    
$d = -$swap;

        /* if ($bNeg && !$aNeg) { $a = clone $int; $b = clone $this; } elseif($bNeg && $aNeg) { $a = $this->mulInt(-1); $b = $int->mulInt(-1); } */
        $x = $a->xorInt64($b)->mask64($d$d);
        return array(
            $a->xorInt64($x)->mulInt($m),
            $b->xorInt64($x)->mulInt($m)
        );
    }

    /** * @param array<int, int> $a * @param array<int, int> $b * @param int $baseLog2 * @return array<int, int> */

    public static function sipRound(array $v)
    {
        # v0 += v1;         $v[0] = $v[0]->addInt64($v[1]);

        # v1 = ROTL(v1, 13);         $v[1] = $v[1]->rotateLeft(13);

        # v1 ^= v0;         $v[1] = $v[1]->xorInt64($v[0]);

        # v0=ROTL(v0,32);         $v[0] = $v[0]->rotateLeft(32);

        # v2 += v3;         $v[2] = $v[2]->addInt64($v[3]);

        # v3=ROTL(v3,16);         $v[3] = $v[3]->rotateLeft(16);

        # v3 ^= v2;
Home | Imprint | This part of the site doesn't use cookies.