Make WordPress Core


Ignore:
Timestamp:
05/17/2019 10:57:19 AM (5 years ago)
Author:
tellyworth
Message:

Upgrade/Install: Update sodium_compat to v1.10.0.

This adds a runtime_speed_test() method for estimating if the 32-bit implementation is fast enough for expensive computations.

Props paragoninitiativeenterprises.
See #47186.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sodium_compat/src/Core/Curve25519/Fe.php

    r44953 r45344  
    1313{
    1414    /**
    15      * @var array
     15     * @var array<int, int>
    1616     */
    1717    protected $container = array();
     
    2525     * @internal You should not use this directly from another application
    2626     *
    27      * @param array $array
     27     * @param array<int, int> $array
    2828     * @param bool $save_indexes
    2929     * @return self
     
    3838        }
    3939        $array = array_values($array);
     40        /** @var array<int, int> $keys */
    4041
    4142        $obj = new ParagonIE_Sodium_Core_Curve25519_Fe();
     
    5556     * @internal You should not use this directly from another application
    5657     *
    57      * @param mixed $offset
    58      * @param mixed $value
     58     * @param int|null $offset
     59     * @param int $value
    5960     * @return void
    6061     * @psalm-suppress MixedArrayOffset
     
    7576     * @internal You should not use this directly from another application
    7677     *
    77      * @param mixed $offset
     78     * @param int $offset
    7879     * @return bool
    7980     * @psalm-suppress MixedArrayOffset
     
    8788     * @internal You should not use this directly from another application
    8889     *
    89      * @param mixed $offset
     90     * @param int $offset
    9091     * @return void
    9192     * @psalm-suppress MixedArrayOffset
     
    99100     * @internal You should not use this directly from another application
    100101     *
    101      * @param mixed $offset
    102      * @return mixed|null
     102     * @param int $offset
     103     * @return int
    103104     * @psalm-suppress MixedArrayOffset
    104105     */
    105106    public function offsetGet($offset)
    106107    {
    107         return isset($this->container[$offset])
    108             ? $this->container[$offset]
    109             : null;
     108        if (!isset($this->container[$offset])) {
     109            $this->container[$offset] = 0;
     110        }
     111        return (int) ($this->container[$offset]);
    110112    }
    111113
Note: See TracChangeset for help on using the changeset viewer.