You are here

public function ParagonIE_Sodium_Core32_SecretStream_State::__construct in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php \ParagonIE_Sodium_Core32_SecretStream_State::__construct()

ParagonIE_Sodium_Core32_SecretStream_State constructor.

Parameters

string $key:

string|null $nonce:

File

vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php, line 25

Class

ParagonIE_Sodium_Core32_SecretStream_State
Class ParagonIE_Sodium_Core32_SecretStream_State

Code

public function __construct($key, $nonce = null) {
  $this->key = $key;
  $this->counter = 1;
  if (is_null($nonce)) {
    $nonce = str_repeat("\0", 12);
  }
  $this->nonce = str_pad($nonce, 12, "\0", STR_PAD_RIGHT);
  $this->_pad = str_repeat("\0", 4);
}