# ParagonIE_Sodium_Core32_ChaCha20::quarterRound

## #Summery Summery

The ChaCha20 quarter round function. Works on four 32-bit integers.

## #Syntax Syntax

ParagonIE_Sodium_Core32_ChaCha20::quarterRound( ParagonIE_Sodium_Core32_Int32 \$a, ParagonIE_Sodium_Core32_Int32 \$b, ParagonIE_Sodium_Core32_Int32 \$c, ParagonIE_Sodium_Core32_Int32 \$d )

\$a

(Required)

\$b

(Required)

\$c

(Required)

\$d

(Required)

## #Return Return

(array<int,) ParagonIE_Sodium_Core32_Int32>

## #Source Source

```    protected static function quarterRound(
ParagonIE_Sodium_Core32_Int32 \$a,
ParagonIE_Sodium_Core32_Int32 \$b,
ParagonIE_Sodium_Core32_Int32 \$c,
ParagonIE_Sodium_Core32_Int32 \$d
) {
/** @var ParagonIE_Sodium_Core32_Int32 \$a */
/** @var ParagonIE_Sodium_Core32_Int32 \$b */
/** @var ParagonIE_Sodium_Core32_Int32 \$c */
/** @var ParagonIE_Sodium_Core32_Int32 \$d */

# a = PLUS(a,b); d = ROTATE(XOR(d,a),16);
\$d = \$d->xorInt32(\$a)->rotateLeft(16);

# c = PLUS(c,d); b = ROTATE(XOR(b,c),12);
\$b = \$b->xorInt32(\$c)->rotateLeft(12);

# a = PLUS(a,b); d = ROTATE(XOR(d,a), 8);