ParagonIE_Sodium_Core32_ChaCha20::quarterRound() protected WP 1.0
The ChaCha20 quarter round function. Works on four 32-bit integers.
{} Это метод класса: ParagonIE_Sodium_Core32_ChaCha20{}
Хуков нет.
Возвращает
Массив<Число,. ParagonIE_Sodium_Core32_Int32>
Использование
$result = ParagonIE_Sodium_Core32_ChaCha20::quarterRound(;
Код ParagonIE_Sodium_Core32_ChaCha20::quarterRound() ParagonIE Sodium Core32 ChaCha20::quarterRound WP 5.6.2
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);
$a = $a->addInt32($b);
$d = $d->xorInt32($a)->rotateLeft(16);
# c = PLUS(c,d); b = ROTATE(XOR(b,c),12);
$c = $c->addInt32($d);
$b = $b->xorInt32($c)->rotateLeft(12);
# a = PLUS(a,b); d = ROTATE(XOR(d,a), 8);
$a = $a->addInt32($b);
$d = $d->xorInt32($a)->rotateLeft(8);
# c = PLUS(c,d); b = ROTATE(XOR(b,c), 7);
$c = $c->addInt32($d);
$b = $b->xorInt32($c)->rotateLeft(7);
return array($a, $b, $c, $d);
}