: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if (class_exists('ParagonIE_Sodium_Core32_Curve25519_Fe', false)) {
* Class ParagonIE_Sodium_Core32_Curve25519_Fe
* This represents a Field Element
class ParagonIE_Sodium_Core32_Curve25519_Fe implements ArrayAccess
* @var array<int, ParagonIE_Sodium_Core32_Int32>
protected $container = array();
* @internal You should not use this directly from another application
* @param array<int, ParagonIE_Sodium_Core32_Int32> $array
* @param bool $save_indexes
* @throws SodiumException
public static function fromArray($array, $save_indexes = null)
$keys = array_keys($array);
$keys = range(0, $count - 1);
$array = array_values($array);
$obj = new ParagonIE_Sodium_Core32_Curve25519_Fe();
for ($i = 0; $i < $count; ++$i) {
$array[$i]->overflow = 0;
$obj->offsetSet($keys[$i], $array[$i]);
for ($i = 0; $i < $count; ++$i) {
if (!($array[$i] instanceof ParagonIE_Sodium_Core32_Int32)) {
throw new TypeError('Expected ParagonIE_Sodium_Core32_Int32');
$array[$i]->overflow = 0;
$obj->offsetSet($i, $array[$i]);
* @internal You should not use this directly from another application
* @param array<int, int> $array
* @param bool $save_indexes
* @throws SodiumException
public static function fromIntArray($array, $save_indexes = null)
$keys = array_keys($array);
$keys = range(0, $count - 1);
$array = array_values($array);
foreach ($array as $i => $v) {
$set[$i] = ParagonIE_Sodium_Core32_Int32::fromInt($v);
$obj = new ParagonIE_Sodium_Core32_Curve25519_Fe();
for ($i = 0; $i < $count; ++$i) {
$obj->offsetSet($keys[$i], $set[$i]);
for ($i = 0; $i < $count; ++$i) {
$obj->offsetSet($i, $set[$i]);
* @internal You should not use this directly from another application
* @throws SodiumException
public function offsetSet($offset, $value)
if (!($value instanceof ParagonIE_Sodium_Core32_Int32)) {
throw new InvalidArgumentException('Expected an instance of ParagonIE_Sodium_Core32_Int32');
$this->container[] = $value;
ParagonIE_Sodium_Core32_Util::declareScalarType($offset, 'int', 1);
$this->container[(int) $offset] = $value;
* @internal You should not use this directly from another application
* @psalm-suppress MixedArrayOffset
public function offsetExists($offset)
return isset($this->container[$offset]);
* @internal You should not use this directly from another application
* @psalm-suppress MixedArrayOffset
public function offsetUnset($offset)
unset($this->container[$offset]);
* @internal You should not use this directly from another application
* @return ParagonIE_Sodium_Core32_Int32
* @psalm-suppress MixedArrayOffset
public function offsetGet($offset)
if (!isset($this->container[$offset])) {
$this->container[(int) $offset] = new ParagonIE_Sodium_Core32_Int32();
/** @var ParagonIE_Sodium_Core32_Int32 $get */
$get = $this->container[$offset];
* @internal You should not use this directly from another application
public function __debugInfo()
if (empty($this->container)) {
(int) ($this->container[0]->toInt()),
(int) ($this->container[1]->toInt()),
(int) ($this->container[2]->toInt()),
(int) ($this->container[3]->toInt()),
(int) ($this->container[4]->toInt()),
(int) ($this->container[5]->toInt()),
(int) ($this->container[6]->toInt()),
(int) ($this->container[7]->toInt()),
(int) ($this->container[8]->toInt()),
(int) ($this->container[9]->toInt())
return array(implode(', ', $c));