You are here

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

Parameters

string $newKeyAndNonce:

Return value

self

File

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

Class

ParagonIE_Sodium_Core32_SecretStream_State
Class ParagonIE_Sodium_Core32_SecretStream_State

Code

public function rekey($newKeyAndNonce) {
  $this->key = ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 0, 32);
  $this->nonce = str_pad(ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 32), 12, "\0", STR_PAD_RIGHT);
  return $this;
}