ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_encrypt() public WP 1.0
AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce)
{} It's a method of the class: ParagonIE_Sodium_Crypto{}
No Hooks.
Return
String
. Null. Nothing.
Usage
$result = ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_encrypt(;
Code of ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_encrypt() ParagonIE Sodium Crypto::aead xchacha20poly1305 ietf encrypt WP 5.7
public static function aead_xchacha20poly1305_ietf_encrypt(
$message = '',
$ad = '',
$nonce = '',
$key = ''
) {
$subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20(
ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16),
$key
);
$nonceLast = "\x00\x00\x00\x00" .
ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8);
return self::aead_chacha20poly1305_ietf_encrypt($message, $ad, $nonceLast, $subkey);
}