public static function ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_decrypt in Automatic Updates 8
Same name and namespace in other branches
- 7 vendor/paragonie/sodium_compat/src/Crypto.php \ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_decrypt()
AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)
@internal Do not use this directly. Use ParagonIE_Sodium_Compat.
Parameters
string $message:
string $ad:
string $nonce:
string $key:
Return value
string
Throws
SodiumException
TypeError
1 call to ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_decrypt()
- ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt in vendor/
paragonie/ sodium_compat/ src/ Compat.php - Authenticated Encryption with Associated Data: Decryption
File
- vendor/
paragonie/ sodium_compat/ src/ Crypto.php, line 329
Class
- ParagonIE_Sodium_Crypto
- Class ParagonIE_Sodium_Crypto
Code
public static function aead_xchacha20poly1305_ietf_decrypt($message = '', $ad = '', $nonce = '', $key = '') {
$subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16), $key);
$nonceLast = "\0\0\0\0" . ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8);
return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey);
}