ParagonIE_Sodium_Core32_SipHash::sipRound

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core32_SipHash::sipRound( $v )

Parameters Parameters

(<span class="arrayarray<int,) (Required) ParagonIE_Sodium_Core32_Int64> $v

Return Return

(array<int,) ParagonIE_Sodium_Core32_Int64>

Source Source

File: wp-includes/sodium_compat/src/Core32/SipHash.php

    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;
        $v[3] = $v[3]->xorInt64($v[2]);

        # v0 += v3;
        $v[0] = $v[0]->addInt64($v[3]);

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

        # v3 ^= v0;
        $v[3] = $v[3]->xorInt64($v[0]);

        # v2 += v1;
        $v[2] = $v[2]->addInt64($v[1]);

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

        #  v1 ^= v2;
        $v[1] = $v[1]->xorInt64($v[2]);

        # v2=ROTL(v2,32)
        $v[2] = $v[2]->rotateLeft(32);

        return $v;
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.