$ docker run --rm --name validator-libsodium-usage-php83-r18-crypto-aead-chacha20poly1305-ietf-tag-length-2732 -t --mount type=bind,src=/tmp/validator-status-libsodium-usage-php83-r18-crypto-aead-chacha20poly1305-ietf-tag-length,dst=/validator/status validator-libsodium-shared bash -lc 'set -euo pipefail /validator/tests/_shared/install_override_debs.sh exec /validator/tests/_shared/run_library_tests.sh "$@"' validator-testcase libsodium usage-php83-r18-crypto-aead-chacha20poly1305-ietf-tag-length -- bash -c 'PS4=$1; shift; set -x; source "$@"' validator-xtrace '__VALIDATOR_XTRACE__ ' /validator/tests/libsodium/tests/cases/usage/usage-php83-r18-crypto-aead-chacha20poly1305-ietf-tag-length.sh no override packages found; continuing with apt originals $key = random_bytes(SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES); $nonce = random_bytes(SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES); $aad = "r18-php-aad-context"; $msg = "r18 php chacha20poly1305 ietf payload"; $ct = sodium_crypto_aead_chacha20poly1305_ietf_encrypt($msg, $aad, $nonce, $key); $expected = strlen($msg) + SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES; if (strlen($ct) !== $expected) { fwrite(STDERR, "ct_len=" . strlen($ct) . " expected=" . $expected . "\n"); exit(1); } $pt = sodium_crypto_aead_chacha20poly1305_ietf_decrypt($ct, $aad, $nonce, $key); if ($pt !== $msg) { fwrite(STDERR, "pt mismatch\n"); exit(1); } echo "ok aead ct=", strlen($ct), PHP_EOL; ' ok aead ct=53