ParagonIE_Sodium_Core32_SecretStream_State::__construct

Advertisement

Summery Summery

ParagonIE_Sodium_Core32_SecretStream_State constructor.

Syntax Syntax

ParagonIE_Sodium_Core32_SecretStream_State::__construct( string $key, string|null $nonce = null )

Parameters Parameters

$key

(Required)

$nonce

(Optional)

Default value: null

Source Source

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

    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);
    }

Advertisement

Advertisement

Leave a Reply