ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_pull() public WP 1.0
{} Это метод класса: ParagonIE_Sodium_Crypto32{}
Хуков нет.
Возвращает
Строку
. Returns a state.
Использование
$result = ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_pull( $key, $header );
- $key(строка) (обязательный)
- -
- $header(строка) (обязательный)
- -
Код ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_pull() ParagonIE Sodium Crypto32::secretstream xchacha20poly1305 init pull WP 5.7.1
public static function secretstream_xchacha20poly1305_init_pull($key, $header)
{
# crypto_core_hchacha20(state->k, in, k, NULL);
$subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20(
ParagonIE_Sodium_Core32_Util::substr($header, 0, 16),
$key
);
$state = new ParagonIE_Sodium_Core32_SecretStream_State(
$subkey,
ParagonIE_Sodium_Core32_Util::substr($header, 16)
);
$state->counterReset();
# memcpy(STATE_INONCE(state), in + crypto_core_hchacha20_INPUTBYTES,
# crypto_secretstream_xchacha20poly1305_INONCEBYTES);
# memset(state->_pad, 0, sizeof state->_pad);
# return 0;
return $state->toString();
}