public static function ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_encrypt 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_encrypt()
AEAD Encryption 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_encrypt()
- ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt in vendor/
paragonie/ sodium_compat/ src/ Compat.php - Authenticated Encryption with Associated Data
File
- vendor/
paragonie/ sodium_compat/ src/ Crypto32.php, line 358
Class
- ParagonIE_Sodium_Crypto32
- Class ParagonIE_Sodium_Crypto
Code
public static function aead_xchacha20poly1305_ietf_encrypt($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_encrypt($message, $ad, $nonceLast, $subkey);
}