ParagonIE_Sodium_Core32_ChaCha20_IetfCtx::__construct()
ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor.
{} Это метод класса: ParagonIE_Sodium_Core32_ChaCha20_IetfCtx{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$ParagonIE_Sodium_Core32_ChaCha20_IetfCtx = new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx(); $ParagonIE_Sodium_Core32_ChaCha20_IetfCtx->__construct( $key, $iv, $counter );
- $key(строка)
- ChaCha20 key.
По умолчанию: '' - $iv(строка)
- Initialization Vector (a.k.a. nonce).
По умолчанию: '' - $counter(строка)
- The initial counter value.
По умолчанию: 4 0x00 bytes
Код ParagonIE_Sodium_Core32_ChaCha20_IetfCtx::__construct() ParagonIE Sodium Core32 ChaCha20 IetfCtx:: construct WP 5.9.3
public function __construct($key = '', $iv = '', $counter = '') { if (self::strlen($iv) !== 12) { throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.'); } parent::__construct($key, self::substr($iv, 0, 8), $counter); if (!empty($counter)) { $this->container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4)); } $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4)); $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4)); $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 8, 4)); }