WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core_ChaCha20::quarterRound() protected WP 1.0

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

{} It's a method of the class: ParagonIE_Sodium_Core_ChaCha20{}

No Hooks.

Return

Array. int>

Usage

$result = ParagonIE_Sodium_Core_ChaCha20::quarterRound( $a, $b, $c, $d );
$a(int) (required)
-
$b(int) (required)
-
$c(int) (required)
-
$d(int) (required)
-

Code of ParagonIE_Sodium_Core_ChaCha20::quarterRound() WP 5.8.2

protected static function quarterRound($a, $b, $c, $d)
{
    # a = PLUS(a,b); d = ROTATE(XOR(d,a),16);
    /** @var int $a */
    $a = ($a + $b) & 0xffffffff;
    $d = self::rotate($d ^ $a, 16);

    # c = PLUS(c,d); b = ROTATE(XOR(b,c),12);
    /** @var int $c */
    $c = ($c + $d) & 0xffffffff;
    $b = self::rotate($b ^ $c, 12);

    # a = PLUS(a,b); d = ROTATE(XOR(d,a), 8);
    /** @var int $a */
    $a = ($a + $b) & 0xffffffff;
    $d = self::rotate($d ^ $a, 8);

    # c = PLUS(c,d); b = ROTATE(XOR(b,c), 7);
    /** @var int $c */
    $c = ($c + $d) & 0xffffffff;
    $b = self::rotate($b ^ $c, 7);
    return array((int) $a, (int) $b, (int) $c, (int) $d);
}