public static function ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_decrypt in Automatic Updates 7
Same name and namespace in other branches
- 8 vendor/paragonie/sodium_compat/src/Crypto32.php \ParagonIE_Sodium_Crypto32::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_Crypto32::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/ Crypto32.php, line 329
Class
- ParagonIE_Sodium_Crypto32
- Class ParagonIE_Sodium_Crypto
Code
public static function aead_xchacha20poly1305_ietf_decrypt($message = '', $ad = '', $nonce = '', $key = '') {
$subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20(ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16), $key);
$nonceLast = "\0\0\0\0" . ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8);
return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey);
}