wppaste
WordPress

ParagonIE_Sodium_Core_Poly1305_State

Source
wp-includes/sodium_compat/src/Core/Poly1305/State.php:10
Class ParagonIE_Sodium_Core_Poly1305_State

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 · 6

$bufferarray<int,protected
$finalboolprotected
$harray<int,public
$leftoverintprotected
$rint[]public
$padint[]public

Methods · 5

Source code

class ParagonIE_Sodium_Core_Poly1305_State extends ParagonIE_Sodium_Core_Util{    /**     * @var array<int, int>     */    protected $buffer = array();     /**     * @var bool     */    protected $final = false;     /**     * @var array<int, int>     */    public $h;     /**     * @var int     */    protected $leftover = 0;     /**     * @var int[]     */    public $r;     /**     * @var int[]     */    public $pad;     /**     * ParagonIE_Sodium_Core_Poly1305_State constructor.     *     * @internal You should not use this directly from another application     *     * @param string $key     * @throws InvalidArgumentException     * @throws TypeError     */    public function __construct($key = '')    {        if (self::strlen($key) < 32) {            throw new InvalidArgumentException(                'Poly1305 requires a 32-byte key'            );        }        /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */        $this->r = array(            (int) ((self::load_4(self::substr($key, 0, 4))) & 0x3ffffff),            (int) ((self::load_4(self::substr($key, 3, 4)) >> 2) & 0x3ffff03),            (int) ((self::load_4(self::substr($key, 6, 4)) >> 4) & 0x3ffc0ff),            (int) ((self::load_4(self::substr($key, 9, 4)) >> 6) & 0x3f03fff),            (int) ((self::load_4(self::substr($key, 12, 4)) >> 8) & 0x00fffff)        );         /* h = 0 */        $this->h = array(0, 0, 0, 0, 0);         /* save pad for later */        $this->pad = array(            self::load_4(self::substr($key, 16, 4)),            self::load_4(self::substr($key, 20, 4)),            self::load_4(self::substr($key, 24, 4)),            self::load_4(self::substr($key, 28, 4)),        );         $this->leftover = 0;        $this->final = false;    }     /**     * Zero internal buffer upon destruction     */    public function __destruct()    {        $this->r[0] ^= $this->r[0];        $this->r[1] ^= $this->r[1];        $this->r[2] ^= $this->r[2];

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/Poly1305/State.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.