ParagonIE_Sodium_Core_SecretStream_State::rekey

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core_SecretStream_State::rekey( string $newKeyAndNonce )

Parameters Parameters

$newKeyAndNonce

(Required)

Return Return

(self)

Source Source

File: wp-includes/sodium_compat/src/Core/SecretStream/State.php

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

Advertisement

Advertisement

Leave a Reply