wppaste
WordPress

ParagonIE_Sodium_Core_AES

Source
wp-includes/sodium_compat/src/Core/AES.php:14
Bitsliced implementation of the AES block cipher.

Description

Based on the implementation provided by BearSSL.

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).

Properties · 1

$Rconint[]private static

Methods · 12

Source code

class ParagonIE_Sodium_Core_AES extends ParagonIE_Sodium_Core_Util{    /**     * @var int[] AES round constants     */    private static $Rcon = array(        0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36    );     /**     * Mutates the values of $q!     *     * @param ParagonIE_Sodium_Core_AES_Block $q     * @return void     */    public static function sbox(ParagonIE_Sodium_Core_AES_Block $q)    {        /**         * @var int $x0         * @var int $x1         * @var int $x2         * @var int $x3         * @var int $x4         * @var int $x5         * @var int $x6         * @var int $x7         */        $x0 = $q[7] & self::U32_MAX;        $x1 = $q[6] & self::U32_MAX;        $x2 = $q[5] & self::U32_MAX;        $x3 = $q[4] & self::U32_MAX;        $x4 = $q[3] & self::U32_MAX;        $x5 = $q[2] & self::U32_MAX;        $x6 = $q[1] & self::U32_MAX;        $x7 = $q[0] & self::U32_MAX;         $y14 = $x3 ^ $x5;        $y13 = $x0 ^ $x6;        $y9 = $x0 ^ $x3;        $y8 = $x0 ^ $x5;        $t0 = $x1 ^ $x2;        $y1 = $t0 ^ $x7;        $y4 = $y1 ^ $x3;        $y12 = $y13 ^ $y14;        $y2 = $y1 ^ $x0;        $y5 = $y1 ^ $x6;        $y3 = $y5 ^ $y8;        $t1 = $x4 ^ $y12;        $y15 = $t1 ^ $x5;        $y20 = $t1 ^ $x1;        $y6 = $y15 ^ $x7;        $y10 = $y15 ^ $t0;        $y11 = $y20 ^ $y9;        $y7 = $x7 ^ $y11;        $y17 = $y10 ^ $y11;        $y19 = $y10 ^ $y8;        $y16 = $t0 ^ $y11;        $y21 = $y13 ^ $y16;        $y18 = $x0 ^ $y16;         /*         * Non-linear section.         */        $t2 = $y12 & $y15;        $t3 = $y3 & $y6;        $t4 = $t3 ^ $t2;        $t5 = $y4 & $x7;        $t6 = $t5 ^ $t2;        $t7 = $y13 & $y16;        $t8 = $y5 & $y1;        $t9 = $t8 ^ $t7;        $t10 = $y2 & $y7;        $t11 = $t10 ^ $t7;        $t12 = $y9 & $y11;        $t13 = $y14 & $y17;        $t14 = $t13 ^ $t12;        $t15 = $y8 & $y10;        $t16 = $t15 ^ $t12;        $t17 = $t4 ^ $t14;        $t18 = $t6 ^ $t16;

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/Core/AES.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.