wppaste
WordPress

ParagonIE_Sodium_Core32_ChaCha20

Source
wp-includes/sodium_compat/src/Core32/ChaCha20.php:10
Class ParagonIE_Sodium_Core32_ChaCha20

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Methods · 6

Source code

class ParagonIE_Sodium_Core32_ChaCha20 extends ParagonIE_Sodium_Core32_Util{    /**     * The ChaCha20 quarter round function. Works on four 32-bit integers.     *     * @internal You should not use this directly from another application     *     * @param ParagonIE_Sodium_Core32_Int32 $a     * @param ParagonIE_Sodium_Core32_Int32 $b     * @param ParagonIE_Sodium_Core32_Int32 $c     * @param ParagonIE_Sodium_Core32_Int32 $d     * @return array<int, ParagonIE_Sodium_Core32_Int32>     * @throws SodiumException     * @throws TypeError     */    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);    }     /**     * @internal You should not use this directly from another application     *     * @param ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx     * @param string $message     *     * @return string     * @throws SodiumException     * @throws TypeError     */    public static function encryptBytes(        ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx,        $message = ''    ) {        $bytes = self::strlen($message);         /** @var ParagonIE_Sodium_Core32_Int32 $x0 */        /** @var ParagonIE_Sodium_Core32_Int32 $x1 */        /** @var ParagonIE_Sodium_Core32_Int32 $x2 */        /** @var ParagonIE_Sodium_Core32_Int32 $x3 */        /** @var ParagonIE_Sodium_Core32_Int32 $x4 */        /** @var ParagonIE_Sodium_Core32_Int32 $x5 */        /** @var ParagonIE_Sodium_Core32_Int32 $x6 */        /** @var ParagonIE_Sodium_Core32_Int32 $x7 */        /** @var ParagonIE_Sodium_Core32_Int32 $x8 */        /** @var ParagonIE_Sodium_Core32_Int32 $x9 */        /** @var ParagonIE_Sodium_Core32_Int32 $x10 */        /** @var ParagonIE_Sodium_Core32_Int32 $x11 */        /** @var ParagonIE_Sodium_Core32_Int32 $x12 */        /** @var ParagonIE_Sodium_Core32_Int32 $x13 */        /** @var ParagonIE_Sodium_Core32_Int32 $x14 */        /** @var ParagonIE_Sodium_Core32_Int32 $x15 */         /*        j0 = ctx->input[0];

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/sodium_compat/src/Core32/ChaCha20.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.