quarterRound example

$x9 =  (int) $j9;
            $x10 = (int) $j10;
            $x11 = (int) $j11;
            $x12 = (int) $j12;
            $x13 = (int) $j13;
            $x14 = (int) $j14;
            $x15 = (int) $j15;

            # for (i = 20; i > 0; i -= 2) {             for ($i = 20; $i > 0; $i -= 2) {
                # QUARTERROUND( x0, x4, x8, x12)                 list($x0$x4$x8$x12) = self::quarterRound($x0$x4$x8$x12);

                # QUARTERROUND( x1, x5, x9, x13)                 list($x1$x5$x9$x13) = self::quarterRound($x1$x5$x9$x13);

                # QUARTERROUND( x2, x6, x10, x14)                 list($x2$x6$x10$x14) = self::quarterRound($x2$x6$x10$x14);

                # QUARTERROUND( x3, x7, x11, x15)                 list($x3$x7$x11$x15) = self::quarterRound($x3$x7$x11$x15);

                # QUARTERROUND( x0, x5, x10, x15)
$x9 =  clone $j9;
            $x10 = clone $j10;
            $x11 = clone $j11;
            $x12 = clone $j12;
            $x13 = clone $j13;
            $x14 = clone $j14;
            $x15 = clone $j15;

            # for (i = 20; i > 0; i -= 2) {             for ($i = 20; $i > 0; $i -= 2) {
                # QUARTERROUND( x0, x4, x8, x12)                 list($x0$x4$x8$x12) = self::quarterRound($x0$x4$x8$x12);

                # QUARTERROUND( x1, x5, x9, x13)                 list($x1$x5$x9$x13) = self::quarterRound($x1$x5$x9$x13);

                # QUARTERROUND( x2, x6, x10, x14)                 list($x2$x6$x10$x14) = self::quarterRound($x2$x6$x10$x14);

                # QUARTERROUND( x3, x7, x11, x15)                 list($x3$x7$x11$x15) = self::quarterRound($x3$x7$x11$x15);

                # QUARTERROUND( x0, x5, x10, x15)
/** @var ParagonIE_Sodium_Core32_Int32 $x12 */
        $x12 = $ctx[12];
        /** @var ParagonIE_Sodium_Core32_Int32 $x13 */
        $x13 = $ctx[13];
        /** @var ParagonIE_Sodium_Core32_Int32 $x14 */
        $x14 = $ctx[14];
        /** @var ParagonIE_Sodium_Core32_Int32 $x15 */
        $x15 = $ctx[15];

        for ($i = 0; $i < 10; ++$i) {
            # QUARTERROUND( x0, x4, x8, x12)             list($x0$x4$x8$x12) = self::quarterRound($x0$x4$x8$x12);

            # QUARTERROUND( x1, x5, x9, x13)             list($x1$x5$x9$x13) = self::quarterRound($x1$x5$x9$x13);

            # QUARTERROUND( x2, x6, x10, x14)             list($x2$x6$x10$x14) = self::quarterRound($x2$x6$x10$x14);

            # QUARTERROUND( x3, x7, x11, x15)             list($x3$x7$x11$x15) = self::quarterRound($x3$x7$x11$x15);

            # QUARTERROUND( x0, x5, x10, x15)
$x8  = (int) $ctx[8];
        $x9  = (int) $ctx[9];
        $x10 = (int) $ctx[10];
        $x11 = (int) $ctx[11];
        $x12 = (int) $ctx[12];
        $x13 = (int) $ctx[13];
        $x14 = (int) $ctx[14];
        $x15 = (int) $ctx[15];

        for ($i = 0; $i < 10; ++$i) {
            # QUARTERROUND( x0, x4, x8, x12)             list($x0$x4$x8$x12) = self::quarterRound($x0$x4$x8$x12);

            # QUARTERROUND( x1, x5, x9, x13)             list($x1$x5$x9$x13) = self::quarterRound($x1$x5$x9$x13);

            # QUARTERROUND( x2, x6, x10, x14)             list($x2$x6$x10$x14) = self::quarterRound($x2$x6$x10$x14);

            # QUARTERROUND( x3, x7, x11, x15)             list($x3$x7$x11$x15) = self::quarterRound($x3$x7$x11$x15);

            # QUARTERROUND( x0, x5, x10, x15)
Home | Imprint | This part of the site doesn't use cookies.