You are here

public function ParagonIE_Sodium_Core32_SecretStream_State::getNonce 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::getNonce()

Return value

string

2 calls to ParagonIE_Sodium_Core32_SecretStream_State::getNonce()
ParagonIE_Sodium_Core32_SecretStream_State::getCombinedNonce in vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php
ParagonIE_Sodium_Core32_SecretStream_State::xorNonce in vendor/paragonie/sodium_compat/src/Core32/SecretStream/State.php

File

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

Class

ParagonIE_Sodium_Core32_SecretStream_State
Class ParagonIE_Sodium_Core32_SecretStream_State

Code

public function getNonce() {
  if (!is_string($this->nonce)) {
    $this->nonce = str_repeat("\0", 12);
  }
  if (ParagonIE_Sodium_Core32_Util::strlen($this->nonce) !== 12) {
    $this->nonce = str_pad($this->nonce, 12, "\0", STR_PAD_RIGHT);
  }
  return $this->nonce;
}