From a5b5b934f7d653007ccb10e834098aa2df1da2b9 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 5 Dec 2024 13:25:55 -0500 Subject: [PATCH 1/7] Add aead::AES_192_GCM --- aws-lc-rs/src/aead.rs | 3 ++- aws-lc-rs/src/aead/aead_ctx.rs | 31 +++++++++++++++++++++++++++---- aws-lc-rs/src/aead/aes_gcm.rs | 15 ++++++++++++++- aws-lc-rs/src/aead/rand_nonce.rs | 1 + aws-lc-rs/src/aead/tls.rs | 2 ++ aws-lc-rs/src/aead/unbound_key.rs | 5 ++++- aws-lc-rs/src/cipher/aes.rs | 3 +++ 7 files changed, 53 insertions(+), 7 deletions(-) diff --git a/aws-lc-rs/src/aead.rs b/aws-lc-rs/src/aead.rs index 1c0e743bab0..74bd8711961 100644 --- a/aws-lc-rs/src/aead.rs +++ b/aws-lc-rs/src/aead.rs @@ -198,7 +198,7 @@ mod tls; mod unbound_key; pub use self::{ - aes_gcm::{AES_128_GCM, AES_128_GCM_SIV, AES_256_GCM, AES_256_GCM_SIV}, + aes_gcm::{AES_128_GCM, AES_128_GCM_SIV, AES_192_GCM, AES_256_GCM, AES_256_GCM_SIV}, chacha::CHACHA20_POLY1305, nonce::{Nonce, NONCE_LEN}, rand_nonce::RandomizedNonceKey, @@ -972,6 +972,7 @@ derive_debug_via_id!(Algorithm); #[allow(non_camel_case_types)] enum AlgorithmID { AES_128_GCM, + AES_192_GCM, AES_256_GCM, AES_128_GCM_SIV, AES_256_GCM_SIV, diff --git a/aws-lc-rs/src/aead/aead_ctx.rs b/aws-lc-rs/src/aead/aead_ctx.rs index 9176de7098c..b1262797af3 100644 --- a/aws-lc-rs/src/aead/aead_ctx.rs +++ b/aws-lc-rs/src/aead/aead_ctx.rs @@ -6,16 +6,16 @@ use core::ptr::null_mut; use crate::cipher::chacha; -use crate::cipher::aes::{AES_128_KEY_LEN, AES_256_KEY_LEN}; +use crate::cipher::aes::{AES_128_KEY_LEN, AES_192_KEY_LEN, AES_256_KEY_LEN}; use crate::error::Unspecified; use crate::ptr::LcPtr; use aws_lc::{ evp_aead_direction_t, evp_aead_direction_t_evp_aead_open, evp_aead_direction_t_evp_aead_seal, EVP_AEAD_CTX_init, EVP_AEAD_CTX_init_with_direction, EVP_AEAD_CTX_zero, EVP_aead_aes_128_gcm, EVP_aead_aes_128_gcm_randnonce, EVP_aead_aes_128_gcm_siv, EVP_aead_aes_128_gcm_tls12, - EVP_aead_aes_128_gcm_tls13, EVP_aead_aes_256_gcm, EVP_aead_aes_256_gcm_randnonce, - EVP_aead_aes_256_gcm_siv, EVP_aead_aes_256_gcm_tls12, EVP_aead_aes_256_gcm_tls13, - EVP_aead_chacha20_poly1305, OPENSSL_malloc, EVP_AEAD_CTX, + EVP_aead_aes_128_gcm_tls13, EVP_aead_aes_192_gcm, EVP_aead_aes_256_gcm, + EVP_aead_aes_256_gcm_randnonce, EVP_aead_aes_256_gcm_siv, EVP_aead_aes_256_gcm_tls12, + EVP_aead_aes_256_gcm_tls13, EVP_aead_chacha20_poly1305, OPENSSL_malloc, EVP_AEAD_CTX, }; pub(crate) enum AeadDirection { @@ -39,6 +39,7 @@ impl From for evp_aead_direction_t { )] pub(crate) enum AeadCtx { AES_128_GCM(LcPtr), + AES_192_GCM(LcPtr), AES_256_GCM(LcPtr), AES_128_GCM_SIV(LcPtr), @@ -78,6 +79,15 @@ impl AeadCtx { )?)) } + pub(crate) fn aes_192_gcm(key_bytes: &[u8], tag_len: usize) -> Result { + Ok(AeadCtx::AES_192_GCM(AeadCtx::aes_192_context( + EVP_aead_aes_192_gcm, + key_bytes, + tag_len, + None, + )?)) + } + pub(crate) fn aes_256_gcm(key_bytes: &[u8], tag_len: usize) -> Result { Ok(AeadCtx::AES_256_GCM(AeadCtx::aes_256_context( EVP_aead_aes_256_gcm, @@ -198,6 +208,18 @@ impl AeadCtx { AeadCtx::build_context(aead, key_bytes, tag_len, direction) } + fn aes_192_context( + aead: unsafe extern "C" fn() -> *const aws_lc::evp_aead_st, + key_bytes: &[u8], + tag_len: usize, + direction: Option, + ) -> Result, Unspecified> { + if AES_192_KEY_LEN != key_bytes.len() { + return Err(Unspecified); + } + AeadCtx::build_context(aead, key_bytes, tag_len, direction) + } + fn aes_256_context( aead: unsafe extern "C" fn() -> *const aws_lc::evp_aead_st, key_bytes: &[u8], @@ -258,6 +280,7 @@ impl AsRef> for AeadCtx { fn as_ref(&self) -> &LcPtr { match self { AeadCtx::AES_128_GCM(ctx) + | AeadCtx::AES_192_GCM(ctx) | AeadCtx::AES_256_GCM(ctx) | AeadCtx::AES_128_GCM_SIV(ctx) | AeadCtx::AES_256_GCM_SIV(ctx) diff --git a/aws-lc-rs/src/aead/aes_gcm.rs b/aws-lc-rs/src/aead/aes_gcm.rs index ed9c9bcf97e..9b60f818d13 100644 --- a/aws-lc-rs/src/aead/aes_gcm.rs +++ b/aws-lc-rs/src/aead/aes_gcm.rs @@ -4,7 +4,7 @@ use crate::aead::{Algorithm, AlgorithmID}; use crate::aead::aead_ctx::AeadCtx; -use crate::cipher::aes::{AES_128_KEY_LEN, AES_256_KEY_LEN}; +use crate::cipher::aes::{AES_128_KEY_LEN, AES_192_KEY_LEN, AES_256_KEY_LEN}; use crate::error::Unspecified; /// AES-128 in GCM mode with 128-bit tags and 96 bit nonces. @@ -15,6 +15,14 @@ pub const AES_128_GCM: Algorithm = Algorithm { max_input_len: u64::MAX, }; +/// AES-192 in GCM mode with 128-bit tags and 96 bit nonces. +pub const AES_192_GCM: Algorithm = Algorithm { + init: init_192_aead, + key_len: AES_192_KEY_LEN, + id: AlgorithmID::AES_192_GCM, + max_input_len: u64::MAX, +}; + /// AES-256 in GCM mode with 128-bit tags and 96 bit nonces. pub const AES_256_GCM: Algorithm = Algorithm { init: init_256_aead, @@ -44,6 +52,11 @@ fn init_128_aead(key: &[u8], tag_len: usize) -> Result { AeadCtx::aes_128_gcm(key, tag_len) } +#[inline] +fn init_192_aead(key: &[u8], tag_len: usize) -> Result { + AeadCtx::aes_192_gcm(key, tag_len) +} + #[inline] fn init_256_aead(key: &[u8], tag_len: usize) -> Result { AeadCtx::aes_256_gcm(key, tag_len) diff --git a/aws-lc-rs/src/aead/rand_nonce.rs b/aws-lc-rs/src/aead/rand_nonce.rs index a0586a8bebe..d6af8265c23 100644 --- a/aws-lc-rs/src/aead/rand_nonce.rs +++ b/aws-lc-rs/src/aead/rand_nonce.rs @@ -36,6 +36,7 @@ impl RandomizedNonceKey { algorithm.nonce_len(), ), AlgorithmID::AES_128_GCM_SIV + | AlgorithmID::AES_192_GCM | AlgorithmID::AES_256_GCM_SIV | AlgorithmID::CHACHA20_POLY1305 => return Err(Unspecified), }?; diff --git a/aws-lc-rs/src/aead/tls.rs b/aws-lc-rs/src/aead/tls.rs index 9331bdf1694..9761df61adf 100644 --- a/aws-lc-rs/src/aead/tls.rs +++ b/aws-lc-rs/src/aead/tls.rs @@ -75,6 +75,7 @@ impl TlsRecordSealingKey { ), ( AlgorithmID::AES_128_GCM_SIV + | AlgorithmID::AES_192_GCM | AlgorithmID::AES_256_GCM_SIV | AlgorithmID::CHACHA20_POLY1305, _, @@ -220,6 +221,7 @@ impl TlsRecordOpeningKey { ), ( AlgorithmID::AES_128_GCM_SIV + | AlgorithmID::AES_192_GCM | AlgorithmID::AES_256_GCM_SIV | AlgorithmID::CHACHA20_POLY1305, _, diff --git a/aws-lc-rs/src/aead/unbound_key.rs b/aws-lc-rs/src/aead/unbound_key.rs index 637148e8d6f..4e17ed2625e 100644 --- a/aws-lc-rs/src/aead/unbound_key.rs +++ b/aws-lc-rs/src/aead/unbound_key.rs @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 OR ISC use super::{aead_ctx::AeadCtx, Algorithm, Nonce, MAX_KEY_LEN, MAX_TAG_LEN, NONCE_LEN}; -use super::{Tag, AES_128_GCM, AES_128_GCM_SIV, AES_256_GCM, AES_256_GCM_SIV, CHACHA20_POLY1305}; +use super::{ + Tag, AES_128_GCM, AES_128_GCM_SIV, AES_192_GCM, AES_256_GCM, AES_256_GCM_SIV, CHACHA20_POLY1305, +}; use crate::iv::FixedLength; use crate::{error::Unspecified, fips::indicator_check, hkdf}; use aws_lc::{ @@ -479,6 +481,7 @@ impl From for UnboundKey { | AeadCtx::AES_128_GCM_TLS12(_) | AeadCtx::AES_128_GCM_TLS13(_) | AeadCtx::AES_128_GCM_RANDNONCE(_) => &AES_128_GCM, + AeadCtx::AES_192_GCM(_) => &AES_192_GCM, AeadCtx::AES_128_GCM_SIV(_) => &AES_128_GCM_SIV, AeadCtx::AES_256_GCM(_) | AeadCtx::AES_256_GCM_RANDNONCE(_) diff --git a/aws-lc-rs/src/cipher/aes.rs b/aws-lc-rs/src/cipher/aes.rs index d2e8202373e..0bea1657180 100644 --- a/aws-lc-rs/src/cipher/aes.rs +++ b/aws-lc-rs/src/cipher/aes.rs @@ -15,6 +15,9 @@ use super::{DecryptionContext, EncryptionContext, OperatingMode, SymmetricCipher /// Length of an AES-128 key in bytes. pub const AES_128_KEY_LEN: usize = 16; +/// Length of an AES-192 key in bytes. +pub const AES_192_KEY_LEN: usize = 24; + /// Length of an AES-256 key in bytes. pub const AES_256_KEY_LEN: usize = 32; From 9bf5fd63ba0ec7f54d800969287be7a74d1c68d6 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 5 Dec 2024 13:47:16 -0500 Subject: [PATCH 2/7] Testing for AES_192_GCM --- aws-lc-rs/src/test.rs | 3 +- aws-lc-rs/tests/aead_test.rs | 8 + .../tests/data/aead_aes_192_gcm_tests.txt | 232 ++++++++++++++++++ 3 files changed, 241 insertions(+), 2 deletions(-) create mode 100644 aws-lc-rs/tests/data/aead_aes_192_gcm_tests.txt diff --git a/aws-lc-rs/src/test.rs b/aws-lc-rs/src/test.rs index 3ec47b1745c..d2743ea75df 100644 --- a/aws-lc-rs/src/test.rs +++ b/aws-lc-rs/src/test.rs @@ -111,6 +111,7 @@ #![doc(hidden)] extern crate alloc; +extern crate std; use std::error::Error; @@ -121,8 +122,6 @@ pub use crate::hex::{ encode_upper as to_hex_upper, }; -extern crate std; - /// `compile_time_assert_clone::();` fails to compile if `T` doesn't /// implement `Clone`. #[allow(clippy::extra_unused_type_parameters)] diff --git a/aws-lc-rs/tests/aead_test.rs b/aws-lc-rs/tests/aead_test.rs index 1423fff187d..be1ffa80740 100644 --- a/aws-lc-rs/tests/aead_test.rs +++ b/aws-lc-rs/tests/aead_test.rs @@ -19,6 +19,14 @@ fn aead_aes_gcm_128() { ); } +#[test] +fn aead_aes_gcm_192() { + test_aead_all( + &aead::AES_192_GCM, + test_file!("data/aead_aes_192_gcm_tests.txt"), + ); +} + #[test] fn aead_aes_gcm_256() { test_aead_all( diff --git a/aws-lc-rs/tests/data/aead_aes_192_gcm_tests.txt b/aws-lc-rs/tests/data/aead_aes_192_gcm_tests.txt new file mode 100644 index 00000000000..3d8c9015ad0 --- /dev/null +++ b/aws-lc-rs/tests/data/aead_aes_192_gcm_tests.txt @@ -0,0 +1,232 @@ +# Test vectors from NIST = http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf + +KEY = 000000000000000000000000000000000000000000000000 +NONCE = 000000000000000000000000 +AD = "" +TAG = cd33b28ac773f74ba00ed1f312572435 +IN = "" +CT = "" + +KEY = 000000000000000000000000000000000000000000000000 +NONCE = 000000000000000000000000 +AD = "" +TAG = 2ff58d80033927ab8ef4d4587514f0fb +IN = 00000000000000000000000000000000 +CT = 98e7247c07f0fe411c267e4384b0f600 + +KEY = feffe9928665731c6d6a8f9467308308feffe9928665731c +NONCE = cafebabefacedbaddecaf888 +AD = "" +TAG = 9924a7c8587336bfb118024db8674a14 +IN = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255 +CT = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade256 + +KEY = feffe9928665731c6d6a8f9467308308feffe9928665731c +NONCE = cafebabefacedbaddecaf888 +AD = feedfacedeadbeeffeedfacedeadbeefabaddad2 +TAG = 2519498e80f1478f37ba55bd6d27618c +IN = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +CT = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710 + +KEY = feffe9928665731c6d6a8f9467308308feffe9928665731c +NONCE = cafebabefacedbad +AD = feedfacedeadbeeffeedfacedeadbeefabaddad2 +TAG = 65dcc57fcf623a24094fcca40d3533f8 +IN = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +CT = 0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f7 +FAILS = WRONG_NONCE_LENGTH + +KEY = feffe9928665731c6d6a8f9467308308feffe9928665731c +NONCE = 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b +AD = feedfacedeadbeeffeedfacedeadbeefabaddad2 +TAG = dcf566ff291c25bbb8568fc3d376a6d9 +IN = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39 +CT = d27e88681ce3243c4830165a8fdcf9ff1de9a1d8e6b447ef6ef7b79828666e4581e79012af34ddd9e2f037589b292db3e67c036745fa22e7e9b7373b +FAILS = WRONG_NONCE_LENGTH + +# 128 bytes plaintext +KEY = 000000000000000000000000000000000000000000000000 +NONCE = 000000000000000000000000 +IN = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +CT = 98e7247c07f0fe411c267e4384b0f6002a3493e66235ee67deeccd2f3b393bd8fdaa17c2cde20268fe36e164ea532151d25ade24b672e804028d47421c330d1c2c14770da5d48ddff538d345a6a0d311088fae361362007a4c1fc8dc5f01e4c947a22acdb60c3a986a8f76ecd0ea3433a2b5d52ac1536ac722df1647e5320341 +AD = "" +TAG = 818944cd5b6f69c6684527cd427db364 + +# 192 bytes plaintext, iv is chosen so that initial counter LSB is 0xFF +KEY = 000000000000000000000000000000000000000000000000 +NONCE = ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +IN = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +CT = 5ee5ab5d8db4169dea39e95a58a332795c542c71cc31fabb0fe106b3c293e64b7bccdbe8649fb144328d0e2dc83b2912bd384ba92963e966ed64813bc7a78303e36691f0cb9d924b15214759679e635b5aba26162f898ce9bd665f504c471856f15c2415263bdea5c9f67d5e85d2939a3089401245e7fa0dee3506ba128432d7670784430a90cafbac33b7d29bd0b856005f9a542e54c17d2616e1d37358eb84b072cbaefd1a3999e1b797f9ca65a1a236d3ecfb3c34af4757003a35904e7336 +AD = "" +TAG = b431a8671dbbfc4477ad254c136c8c6c +FAILS = WRONG_NONCE_LENGTH + +# 288 bytes plaintext, iv is chosen so that initial counter LSB is 0xFF +KEY = 000000000000000000000000000000000000000000000000 +NONCE = ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +IN = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +CT = 5ee5ab5d8db4169dea39e95a58a332795c542c71cc31fabb0fe106b3c293e64b7bccdbe8649fb144328d0e2dc83b2912bd384ba92963e966ed64813bc7a78303e36691f0cb9d924b15214759679e635b5aba26162f898ce9bd665f504c471856f15c2415263bdea5c9f67d5e85d2939a3089401245e7fa0dee3506ba128432d7670784430a90cafbac33b7d29bd0b856005f9a542e54c17d2616e1d37358eb84b072cbaefd1a3999e1b797f9ca65a1a236d3ecfb3c34af4757003a35904e7336e6c0a97c03875652ea6aadc376d25dfa48f395d56513418c5e7751c2c365dabd6545eaf2541aaca6986e91d79aa122043d6e9accccd74183d1f0b09795dc4dc73236f6fe732140e95a6ba96e56724e34d0b1001049a090f1983adc23f1153804 +AD = "" +TAG = 3eb4c7fd5587885e126802ed2e1ba4e5 +FAILS = WRONG_NONCE_LENGTH + +# 256 bytes plaintext +KEY = feffe9928665731c6d6a8f9467308308feffe9928665731c +NONCE = dbcca32ebf9b804617c3aa9e +IN = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeef0ff1f2f3f4f5f6f7f8f9fafbfcfdfeff +AD = 00000000000000000000000000000000101112131415161718191a1b1c1d1e1f +CT = 593154c004c89ff984482056cdf6ab3c508ffbcb35ca1d1c5a7ee98aeb5def4eda0a4ac909139fb52950753e11c0336a25d379041913711b223f510814c31301b17487ed9cf96402c23d9bd900a6d1ec433957a454714ece24166c1db3ab14646e49859fbe8e90ffbde90d02d58fc9b2802155bf39fd32963b529fae577721c9d1638b3c6ef109a4cf6c903393522d2f23abb8b1cd24fc6913aabf2b832f42c2ac389b25e7b9b5a6613a8b60827d9b21a526f3a80e6f44cb602440b1c0463fc3abf2e5c71f985b4e26a9e84da924467c5e935f57eb7a6de8c70fb2530fbfe59c816b0d2a437844b39ecef895c4aa01bb175bf2858c838d0c64fec3bc554bf9c3 +TAG = b3645a3255c9119d08b98319110d19ec + +# 753 bytes plain text, 24 bytes key size, 16 bytes nonce size, 2 bytes AAD size +KEY = c5ede835f119b80c8c5f1ca8a17255fb519c042cca5601bd +NONCE = 38d11a1d829fb3959b039deadff5b88d +IN = 0451dc60c541d0984de77c4d9cc7059d5f972022b560ebbfca11177d9a2d3103ccac30ee683f2daf787df610c1625d8cff79e44b0028a7787da49eff28db55f6648df51720718c12afd9f8d2c2b6529bef3e138b708d76b610ac0bdedd0ec8d47c2f03430a7e01c9c69a314277d90950166e3412b12826178b1cb8e946df1f23894e94bb2a829d29addf6910f22f821067c1d46e36a3fde9f304418e955c8e14e3681b3f829f95d9a3b0dafea5346581164ae81207453403e9e72788db24f5984ba83e611499c029761cc6b841d6d9100a22631400844e11dac12d5eba02b792f4621af21ffd3af64959934111db680170a3701c877cb01ebde3a18ad262dfaddd85e0079ef8b78319d07da0f29f1b4feea23b1995a7e6cd47a4a575a857c4425102d1dc5ad242f3410349a5a70508213dcf9d5a3f0c94dfbe59504d22890082ad24c943a0fd06e194abb1e288f946ad1d66a29c8e82dde9fdc6fe3491ae02cd6abb0f9dfd3d641cfafd8a12705f6592b19eb2693b21532a7ad27ab458e2c86d430282355da834881fbf3aefb038266ba68882b92f24c3b9fe0032b9693bea693b50dc6d3b4d75d7ece2eb70caaacde9f17a81e43cde8b0e2bfadc039ac6e0b39f76f26f7ca8f7aa8f2082c478cf71a1ba6aa0d3def3d1808944b4d1a6d2cfe7cfb51d98a4bf9d9a55f1debc3f82c6ce8e1b5a5b1069808cd07d475cfe387b53c7ea940fdcd4a54c2f6da5ebf23ab539762573cb95840662539cb80adc0e4b38a4e64e653db42f9f084bfc489aaced3254e7e8e546a4ba35716531f721d3f32e470503b80d750041081bae9aa01cc58b1cb44720bf45e4182391c9d7112e100d684193d946deec9049ca873f1efd65cf3966c2028758385fb88d338bf1c00ad90c199604e545b6b572eb162e74853d37f52c48970759e49f7ec670df83ee05fe9a12d574c099e0b0213e42a74cf7683e5e55d88b3a3079574492a640bb0632cc3948f382b813a139f06e93639a30ecfb8a087436d7a0ee4bc9c4ab75107434266280e0fbf638b02955a6aac4faf49235b5 +AD = e46a +CT = e654f384eb6d3479b06a30cbbb1883cb629836385920cf2665f6c8c7634fd18dd63993901399fd0e2faeb7deb40eb234df19051ff1922db3512b7197ab5504b09e637947e32a9948a98ff9e05214085275b6f0a60ad04dfe66ded95421de5a5ad342da1141cc984561a501bc8d0c12bcc881919998b9b6f6c79a43b19ef85f8200c4c4b42cc56c62f486c6cbf61f33308cc7bf0ebd2763e3ad0716582cd2bfb84d77cff1f329b31ed402370c95de80b926524b20ffabdd43d2b7f8796e8dadb546e2bea2d610a0995d2543eefd0d41240dc57e9729155a27d2fd0e702919dc72a55b38e294549ca7978386e0a9c8313c8b7fa4ac8754f492b7b9a4158a311b5a4e6cd6eb35e42d277a45ab73b2ec1afaf08b006f470bb9919d832dcedc9059f0ac4c53751b72567b1c3cd54ab2d6e81ea795d226548bcd8177c1f70bbafd841253681976482fd0018c6256084cfa9ded0b3e02eb5b01092e5f5a7a2f3deb86697a1465d325d402e5d8f74697cfef0add788de3409b0f86c9a4988fbf86851964abc8fbc7bd4a5c378c549f94c18c72586ca4c05498d9f868ca99b7bead1b006b65863e45353f2d29a0bc03787db83654ec5da58789c5ee6032b1a85007f27068a59215a16f88324b8471ecec4c4288a8a328477780147a7dc982f198f081eff13e60ad59a31eeb87eb145f0395c0ca5784e95c9d69e07c6be4967ac3443fcb0a997774fee4518c8fc1dfa9b091d6734fa5762f7979252e6b7676c1885f71bdecad39458cf69f18fd68cbd73e388b59c82aee9ba0a135cacc3deef4ee17e8fba18d8c63c1f1ca564ee7870c041c2e9fbf1cbaabc96551fb8055b7eee4c61b8254dde2cf6054c2d77e9b7a20d189ba3840520a21ef2b4ae0c6396b739ffa417bc8c8327c9138547314446e2a541c58cd88832eed862a932e5a75e6f936cfb0207d62b83ba65f431776745bcdf4b1c19ff75fa050b3636122252536edfd4a7ae4f2cd90bc9f39870b48e9a288492f8cf399c3a58f98ea79071692a2d2df031999c7670ef4c4931fd7f83022ca9bb6a5ac41f1 +TAG = e48258c41cb876efbdde0042b99467ff +FAILS = WRONG_NONCE_LENGTH + +# 822 bytes plain text, 24 bytes key size, 29 bytes nonce size, 26 bytes AAD size +KEY = be2c10b13757690910991669ba3b98b07e6fb5e667241d49 +NONCE = 584b36ba9dcbf0383b5427bfd78f29c9a5edded2831bf2aa73536d97d3 +IN = ce6dafc17010534d0cc09021d6b88a9998ce02dfd1c1a47990b0ae73d1371c1c8d5bba80cc6b66d7f134f83b393ea129cdf51ccf343002fe65984b4e182bd47b64973d008caa5fcdc646e1f7abb9bbccf77b0019189970e8c8b0bc2a846821faa6dfd7560495a69d5fc6a68e325f164fc663b94c38210b664b65edb419a8e6a5328fb1340a9cf7af3cf79946bb3fe08d66fcf1694482dbf8b0a4cd845c687179ef142e6b5f62f4a24c904d6facad68eb6f790cd737bd9713392ab824560a5ab1da25eb34edd927f012fb50958eadd707af179a7f9e052c4ab29449db93d06c20c3a3e04ae8d05cfa22ed2198861773a695afc21bc32154582c7d58e0552463db2c2411529b0cae84acfd1ecd36bbd11fcf651ed80fc6e90d819048e7a13a069137a826c7a6f0e4c574b3b568cc4e554151d2727aed1e43a4f7a03aa4a9221ea23e865c08a967ca7c23d6a9f230d208237bbbabfb94f98238c64630e5fc72bd735c937b30cbd7e5ec64e747a5d9f060f5234210595f01e6b139baf1b663215aa31c93455c0a5585b416950d356f451ee8c7e5b732022e3ec02bbd2dc2dfe63d9ed8d2f66b2caede05573c4dfbdec3f0563fd731552b20ec0530bbca289ebce7efe134f3fa66c572d4c497cf48db6738d136896833bdb3e8c4f81b425d99ab774b365b3afd75f109b4fad5a0cb33f630c4162ade23f7bd2fa2afa904157db1358956df0371ec445ab1cca066cae765eed9255606f3ba962c92a0f0115a2b6482376c561f521bf49e86d3ee4a90e0f15f661bdf3e0e7a12bf78f3f84e8331d82cd76afc19511b5475dc1441f69cc61e333778574707652420f30d8c3cb0410f8301e0efc214142b7c38db5a831afd092053734ce1c8d4398e54b62033c7c06f495329a13b12b2645bb5ccb521cce16c15bed5eef785d588675fbeab5fcb02586ded8da881f9dc57661590963c45db0a46f91e7181fe13047f70e19866af06b150eaba7a8bbce7096f7842671eeb583cc7fbf2ec19720f51d6bd8f280c394b872d518798c5f573c990c4a6e3cbc1b3f1c0e68b74a82467a34025a72c61586e0f822d681f178f99f759a2da7a4a0a28c78f5a600d72c59d89b71f0dcdca500a0363bc1d4bcfd5ea4ccbbd3461cbbb41914713c81404b6c683 +AD = b7d2f3609bca72cf4bce2063fdb224c9d9d3a2f3175e84333982 +CT = 787411c15a48655627548180b64fb8d35064ccae9c7059ec77ed6a003e9dc1530c8af5d310940c73ccd81ba61f71fd2c6e9d9070512adfd4165f9c161c819b56a251d2c877d03a42a490467465953dc8abf9c6ab4e4a7912e0f9a704947a84bc495124d6450d9873cddc358def511664d8fbf54c7d399037d6837382615bc77e15ededeb3ca3e9ebe56e8a4c91cc4cb8f02e9a3ed80327fc73873b60ddb4caf1b3e3bc56bbed67b61069a502764fa822c75ba90f91c71b96900fe013282f0b6a25677984531aa7101b4fccdab539384511056077c54833ab50e1d206df3d8ca517c68800fdb9391d8d5b1916c1035bf627c2df9e00984558865fc93d03c0f3d5d6554d44a9f247f98f625c92b78bebaa33d0c8ceaf7d6c7cdea7a185a4fdf7594ef75f46e556bb1953a4b6c16a765892a9c9de339c61ebd882e04484771883154e2714572e1da77009dcaaed74dfbc50b6a90d8e54beaaa8042d1c189930fc7a191437421caec5a465f4844e522146e2fcab4e8161d40f03c22a392a580d7d7d6ed823146e3aec1a601834e42b7b2679e1c34317f7ab01b51a1f28132b45d31bcf5ccb083884ff3a8affadbc2f989b4920376e429d24d578b05fe66358141e3cddc8dfc813b908978abafeabe73d82cbd9acecc35197c10364e5e4352e340e102320e9449dd82bb083827ab8c88357e382e3cf4c9d601eed899e0f5e11fb63285d91e2cc37626cb6523e844a98e80b2a4ac177dceeb81ca3c0a909bda4f80e346cde954ac755d30bcdf37a11f662b1c886a6414fe4e4f97a17366ff76f9904fecd65e8b1f18ebc6bbd3772d6b22f786f3294bf383113925133d15fa62cecf1742a1a06efc8697bbc2f4115093e383573a42efcd3c7fa5d5ae04e236cd0f09e988c13421a5242c70154ce9497462bb1115f06a79fe82b0e7889b3472daefe2b492a6a30341e5c8eb283fbd94343d8e72ac759e15303d8fb988f8b04fea4aa401af3d8e391f0d461c1168206d4498307f333df8898670c1e9c4fe22041c217b669aa61f596cf6fb126384e3b661378575d69b9ce4761e88ace5bab548a91581ee7e6c47cd918d46e4c4b9b136e6acaa1a205aa369a83cab64d788a9ba3cf765b8ba51240fc5adfafb211528ac577277d661384e982ddf5 +TAG = bfae729d0122fd0b8e3ed1674b6f5ece +FAILS = WRONG_NONCE_LENGTH + +# 991 bytes plain text, 24 bytes key size, 43 bytes nonce size, 30 bytes AAD size +KEY = 6379d960c7e1e60b27ad90505d16c20d19a0507c3487b2ac +NONCE = 90a842794b37840ea5696635a3b68a8eb92533a9884ea794f4e8a75d3718286ae288c05c67d47a670dcb68 +IN = 133456eb4c40b1eb39cd63ffb828dec3562c1b1ee2a0f94f26dcf7dac1b9366a93762acf83bcd674fc7ac4cd49de0d0ebe8a0415b5f8b8ce04361bc54798afde66f48fdf1ec15e2e9185f780f15fed9b029ec3291069f4e8be8c69720b7fc47716459e436dca7599f16586e619f8efc0ede8489ca5ac387b3b7b0f1d1cdffa5c6db25da657d6ff3715aa67fe9ff9b1d2003598fbb6c14c5c643ab4b79f750231e757bb20d91a4bc2e86c6512fdda5e950944addf1287e7ea5c58082fa01031ecab43373dee55e046b84578221445784a3c6d9e4be1325399c29836b5262238d50736585215c926c7ce8a7c0f48b7add7dc32981ce9c6e759ad51deee48e8718da7609212916cf151296d2ce8d4c000707284ecc0c5a45e0476dcebfda057034df38dc3c408d05ff1d1c16f716c9993e25780ff08d1b1f022fe5d4583723c41b2fa2b194ef975a804e721d2e4e05da6aa0a326588068a4cd0ffb955e818811ef2641b34dc55d648e55d694872ee5dec13821134d72fc3db381de8c79b94a53d13d085ca402d31a4d2b39dd9cda0090ff7b32b5881f1e15392776479302386f04754dcff19e05d71f45662443ed8913fe621f2aef17641bfa417f04926c554011df2ea7f2574bb0cdd93e04d6b72539f5c8d37a34a185f1bdc5cce57614832a40d5aefa09f0cb408c77f0967521cd80ad5796ef56a9be03736ad44fe749916f04b40d107ce6770760a8377d468ec14f98541ace63eee20e86f5c37b9a84b78b3f8d5c8bc8bc05ec1a3cba3bead84a0ef982b074bb7386af1c204f20a87fa61051bb905a731534476103a8ca8af0e83e63083df0549ba49021501d466e1e981a279980062df384ca27260b0545a983b18ffe07f58f8cd98760ef807717dc44447191aad1cb93e8b04c10ac2bd05787af00d806f4a606d6f2545c659349532b526d4a1a25d7fccbdf9d47af5fff31ff16ae6820634a81296f3d31fea0041bc9308eed5f1fad467ed4c8e83fb40ce29037e7d877b894252cd565c693d8e4a9ea26711f9f78b403ceb9dbeba2d3b9ee13bd7c0360c2f1a4fd828e71d10771b21f86d3dbeb0272f89cf60d367fcf1f911d70b122653cf98e29daf2f2e92901e3322335c44aad72a66df45267f749178fa3691f7eb5e020ba5e5ef4163753609dede39d69116d4ba30d57d063c264d3c094ab679a2c83ba283ca3db82169920b64729c42ebb146e119e62095424d28a90d7dac499c10b10d29da38b4b3fd1275be5488d0667818a0d59ffb943c0a76076f0e372d03097af43f1c85978a6bf10092f7d3d067902fa7c859a773cc488651135da0a966051d3952d0a19d3633179e9c78d958ade0da984aeaf0b31d5343701b9c5dd3bba03cd8a41ad2ac1b2f0cd4f576b1 +AD = f4c0f2e9486a39c6179aa7424029e80f9a20865af17c24300124a50b764d +CT = 35330dad089ca019969f259baf474fd03ba21a309c204fe296f6b8a61521e8aa8eda9a126422549dd19842e98e379c5810a9c515eacb161d7a76df81cc3c7042ea6d0c8f091eb477ac56c28215b6d92ec31963ea718c56a55b9a1e0a79d7c338c6a680a4dd5410ff8b7e2145f82156826997ed42950f4cdcb1e48eab3003d6f64b2f7ab020be23ec27d14df431c9cc6e1918499f03bdd0dacd33b1e8a339daf676b31eaf79ec81ee36d1990ee8e5680ee8e9d1f239f9356548e15fc3e924ec3df57130181162e516a902b871084498b6c1f436d3dd8f7e554b70d4e68f0772293be90ab5b0c14ead57808b1aaf45800608caa559f9d5c9f34ef8fbe8c1178c5057314479752731e82bd4fe9f203e7cc6ec71fa0725782eb745df5e23f98c2a1d4fbb8542ea64ecbeba6b891216396da883b3f022cdcf5c109d29861d079e4d2cd42956e740446f7a818fe95c8f2a5f5c242b019f391d6a64b232a009fa6ead6150ecd624f9ded9bb9b705ccadc7ed9439c9ac50213adf84b7a46af53abd9824d1b87692a95ecafeb8c1d706d5284cf63fb00ec314c535d12bd2176526e1ef56f47374547969eabb4a05e7137f78d3b22c37300073578b0ccf02bafc889f2fe48566b4ddfe68d779653b028a96b08c3ebaa10bac07f448557c5943a42cb85697b7010757bb022042e0aa90e14de23e726e59ab61b72b6a06ceb736d2f14a91f597054d9a5a65cfa52c5e602ddde2ab8d5628eeb03eb5da175d332b69423a69f1cbec571e1ac4423415d175fb28c9b1c7dfabd9272b696d22c747d79b10b3ca12ca3546d556ea65029c1863ca0b86639107282c75fc7223de6341dcb4d19c4b9809581925dd571c580f69301c1f119e237f757fad35b2aa9d76c32b44bae1f8f216682903455251b9773abee646b8da8d587b2d059e5b6cbc786ac283b67c4701921050f77c593d4e0274f47bad2e3b939d2813522ffe29f3d4b6828d9401f25d4c23d6a5881debc693bfe68cae9e89090068e89a8e2d5e32934ee4f93a0124b63dc4a208162701beff61d7fd0bbe27084accfa1a31778931a6cd1981916d2eadf9dc8144a576ba275aa9e81177f15c61a699036c24c5157866058f3b6e2734ae1dfbec93d5c7080b9460f405c31c8da7541c748b798493baac0fe44699becb37c838a0c51f7ec7e5eb4b6eecd9d83b7ae7967054fb649791c81535acffdf2c45ee8e96f194f1e4cace38e46c78555e3b63f9b33f4329dff57acae3cf11c3947380d8aa2fc309b6ded3d9df39e6730693952a77c0a4c86b45767c0b6de5ad4e80515feb0109e5bff5db295a8c1296643673db9e25594dbf4739361562470f49cd4f16c3e497ba6159b86a0201dbf25073a2b9bfd9e8e345865037a97f342d970 +TAG = 07f7e61a17f692b73d7206024a4af95d +FAILS = WRONG_NONCE_LENGTH + +# 1052 bytes plain text, 24 bytes key size, 10 bytes nonce size, 17 bytes AAD size +KEY = 4f7d748acbd106c4ba9972145a169c09ca3ea5a4c90174af +NONCE = 46f274a31451f5823cc8 +IN = c767ae27e88d125c8a1862bada0a726092a96270153d057601ac28a2b7d154d34f7550b92b5ebbf3e2f1840bd450f045038d31d37a4843f676bbfb17ed3e087fce054bef7e7ffe66c85913a6807b7d0861d4afdb8e611c26909296c02a66ac3d6e9845e13ef348dd7c402a5c64828e00af687ee7b485f354d57d3c88b58a96cba6c612081dee86dbd44617b1b3beb25f8961f53b1c2764b47d032a685612fb31a3b50f0d313b93dbfd011c5531da81fa1f1de0172f7fbb2326cdfd82f2d0deffd4013b0a6c2cf3e9049846ebf36d658b789ae434ad9897c16ec8c73c6ee920ebd35cbb82c83e039ead62c46e7cb062e21419c073e7e29b888358aec1860054edd52bbfb7755911587c155aed7f62095ba60a89ae542e86e18f9f09d6176a287faab0a90dee2045c27c21cc77822814cf1ffc0b23f128ee15c68386f2eaf17283c84e19120dcbbc76a625eb10b4a2e23af44194ce6035e15775d7314aee3d7bbeff8a458fd9aa3c2b5ad4f95631ab3db5ab423bfa3fb8a7be6b048f54a3d14ebca08ea19735bb187cb3bffcbac5a15e4be8af715f3ebc89a8124251d66fca85f13598e79e01a20be499f22ac30f5f7634db095323311ced3968fd2386b5e75d7ce659c78382e9545c248a451ddd1e61a15cdcb2bcfec4c769b963e981f9ffc430236fc189cf00b6d6811971b0bf421365946dadd5524759fc3ed357ddd940fb33935893d0a056d040e81ee3bb63aa04b8a4605022da731ec49774b41df1dcd47db7070694aa0d6751a81a6344b07f64e1107cd70342917162ded77b6d0f848ab010ac0b7983fd70a0e7395287d3b0bfda63cb9513a560013353cd2408240900cadb744bf9b255e4912420e41f8718ce7c60a3afd7730d5417421e126007200c9c4d36aa86142d635e51c46cc1dcc0791d6f80c9c20769581531c2ae1c23af8852ca8c122c2c6501ce3e291158f2cf9896a5b40d8c595458dcea8722f4729293f0049ca0405dae01c76832029aab44dff5463a5f1afa0e848c9e43d91dd0e300c2615226d9911e055a9c7c3ffdec6e2c0f6e0ed5c6103a68e4085b70ab75796a319e779b8301c9d9f34f442bc38a2b95b723279e28257701cf7b5e754fc8c9fd31aa2ee96459a4c4d6fda677b741aeacf65589cef7907bbb392eeb2a6b22a7b3a5f77667a8d1887de9c391d0406891d29160c2b6de9b010008cbf03d5181724398fac2feca28f0b97d370d2197c4e4d5d75d5970f04220b8387824e6d1bb72c6de64ac77ccf0243fabed84f8f4ddb7fbb6dda491c683ef64f8be92a3b138533f7ebb992ab4479d84e9f53f43b9119328ed161c349d3497ea831b7d8f2f23e2a8cfd76426cd6786796bb7ac4726cd1c30a563a8f98d6ccb70b55ede08b9bb6c528aaaca7902090e6991fc23aa72862cb725681fdbba8ee0b495c1457ebf78b63b2cf2dbfcde7a0c41c6616e1490de64091d2b39d0c9e046111bde3c6e74 +AD = 79fc735acce3324ec37cc1a7de5326c0ab +CT = 574d4729ffcdc99caac63b80fd8cbac7b217941814726aa27f19838f0ca8f8a8471eec1c9cbd87406b5cf73b7791ca16497947362ea6a63254adf7a6315d354df145cd2f450415921c6dd942f21402ddfa083d65229a61eb33f18d2ce81d7cb458320b4a679acec4ef5e895daded3153088afe8def41ef2cbc70bc5c46ac2fb399a3aaab26625ac2d93edb6335b5c492bb2b293d85345b97db20fda875b9c7f5912a9b161c89102c6f5882c9cb3a464a0e20868e4c5e6e80b612163346457971377577d16c59f98760d9c4ad3b33c4292595680cd3c8fa23a92f1dd271ead02aa76fd7307beba78a0303929f240b8473991458381a531d350736a6d617870df2e1a1f43b77234954da71937d784eaa51d202239657cfb2af7a50bf1e40b73505c0c232df6f5465f8c870ed6deb14419f06aeba6783283b58841c7e77f615b400305d88da1d38cf624967f55011c08d66a9002b8bb270ad59c94076f6ed1f230a12cff86e6e5b69c26bcc1a13227044decb3724426e7841fe19e51180a433d2902ed7a0a4d8af3da46865d265b244e5789320fd52961ff9eec39f97acd17858e587e6c3a1ed2c67a30d6d0f5b743207b2d7b4a995ee1e25517f4322f5b0f2eee949a163314e1fc54dbfe68285a9e38983a94a53bc3d64a974afa419093f571583cccbbbcdac99000ffd0d65689b7146257ba7f8d7b32e992b5d42a2a47491476dd03f37bcbcf86006e7ac633a17050861472f298801c450bfda4160d7b885234922033a126936d4674aec1a8b5b3659f1a0357f121cbac1e83fc3a62c883fb9eab0c682a4cf3a7ea0036a20439e9d31fe3c25b82beb0e88dc6ba8cd63a98d05816f249e4d1865b074ecbc5b0abc2ffcabb37336e6191c03369b1fea530e4642e70921ade5f543a91410cdad6260728a190fb2e55d58d50debe9538a3aeb7eb620f3799f100fecf30d63ac180151cfc61d076b14637b450bba9129c356e2fa77e85ca32816e3883a322a7f125e07cf427dce3cea3e3ac0ea78b1698e06c095cb683a54fb8431e1a5512e9c6e8f71d85c896c7ba6ddb320d765a44a8a441559b643234d685908e8ef95456919cd4ce42e7191b92de7590a25663f71650e9c6c0c7ea7b1ea18e248a294205a1e73d2f79e143da368b437295e6f529a04975f59a8e6ebb3e1f656c72b7e088eea967f6e34de649bd78dc9d72d0629d8d268911f366cd08cb73bbb4d9d7a3689ce48172a012bfd1ddef0794244f3eaa4067e9686f06d817854962032b9420fccfa49c050698e22a9132f351da1a64e3bc83b03030e13c94f4838018dc5f9eaac7bd949ba9827f3d37154bf4d51293f04feefcf8e3d1ead6aba3423c02a5bac0465cfc1f16b2d14a9befd26dbe27035fc3a791bfc9f7d00038bd7212a2bc9fdff34c778f67983203dc83cefcb6e052c2a83e5ee8a848fd0b33fac3dd030eb96671db582b9fea2c94ad777445f279e616958e3 +TAG = c8a09a54de1a6bd49b9f13aa34b81f30 +FAILS = WRONG_NONCE_LENGTH + +# 1247 bytes plain text, 24 bytes key size, 62 bytes nonce size, 26 bytes AAD size +KEY = 47dbabf246ddd482da988110d5e40ba34f67f9dca6382614 +NONCE = 8890657eeeeae6d170dd95822bdc0b3d6789c5f1e56c7ef85b0e5d87a6ea6894bbc2dd40016d1e2aa750a89461541dc77bddedda01032430404188d5292e +IN = f8f0f568928ad9dd1a4506dc26478e2827da66b81aa209fa5cfaeb87d2736de8dcb1bb2c5cfff908b7be4b8b0d1ae588a8a484f26b0b0f30883f53db905c791a15b6d8ae8458ca43c5fe23b4dba41ef14717c42f0b6c11ce595d4685d8602ab69ecbfc08b79bd3efa880299beeb219249146d8435e0690eca5d8185cea484823ea6644f36d57a04ee27ac094b49c6f69021fe75f897a498936e308927b85d63f78b23f953c0799bb7a49bbab912389f7e83e29fb7e64c75dd12768c62441af97355862cb9ad5c65e38556912f5c96f57bb962c26b8dd1d8f355e8ca863b5b89f5c50b7849ad78c7f003374b1b0c121815de6c372948d3e67fca40a1966744efc4d95e9efd18e52c48e9f47eacdc21eaac37b1336ed43b2ffdb2592b223f4ee2a04be08a0ffb62f8ace1b837f09b117b84130206ee14793e1222ab76a5ab5faecbb9891d6191ec13ad8eb5ff29fa92cb60814bc0fb6c31b68647ff07dd75217976876c8e4dc03a7fe60d07724d15cfaa23ab5fdd646be8bcc98442465e7fe5d7d27e885b7218ebd0c129bec159c872ed7070dc8f8bb2e6d3b128238a61afe30b01c9f9e61c554ce7db53f42b450d859a60084ab3a925a962b47dec1043bdcffd53e9c4567c3c1bc3be9d06984e2fdefc81f76d253a2891f1a4a0688d7b64f6b8f3adecc56590f95670ef6ecc070ae906a078f6585c8c5cf49f2a079c803efb07625c65a58f8552785346a399eb093929bf9b41b625f037ce709fd9b888aa7af8f2b402b449e8c69a6a3de03aad3ffbfa1874acc1b5b635f8ea7e0897c2bc5d13db80f47c452c2c93d63e376ecb3b5379ddefbff8269fc79ad11c6015c4700ab6881ddbfe637353f13ffca107d6d7b1ad9fd0d81eb8c85b197c5ac12a0730fc44fbf3efba35c14c26fa5a0b93d639f9b70b973fadb69c8b3a754599adef92a9851b4b69c39f7b0001abd69d815238b3b8a4ebc7133be75436a676e483b3e39902a31bb37de80605cf82511d4c85c432d5cab6f86bf024ce6670ef8b093519beec6cc20b78fd29ff2f65ff13011202178c6075cfd2e8675da22c0c7d7b388ec21d1d42a8adcd17b8a9d6409eef945efbccd2912b0996e3bebdcff8b5365f4aae3a51bd7968a5fa3a3b45b4e2c1e16263216c55c474235c1f25034aec75585ddbbcf03cdec20fa300dbea3a58daea061fea347d92bf585196f27085fa0068e73f07b9558273dddb2935644d2387b30c709768e56cabdeec622e3c64f8adba9d8b0dd5c3da829942a06a2dec64f0bb2f4b38a0f4c718c4935a1d42046e2774531d104beb47e08c20e3e8385f3a471e678de4ba2a1e87905c821ff5b2a239fe2c28d7ca9b306107212c6a8266cf8ce0c6d5344b0dd7622039969edf50653d01bcecaca253c8cd9f2ce7bf4fd79d958cffec5a77bb72f11596d5445ed1fd7c824e651979ae637250d7196d35e4e87fa57fdb37cf392aac4a96a77a5a283b386df110ac1d96f2fe9fca0bf4fc62c5c50015ebb02718caccb6c19b1f6d180fd4b7353edbebf3d1d817c3c936bc06ff81b61acf84c3b693dc9dd63a7fcacc22330d5fef9782c3aa22c34627e1e645481a2ba1e11a16288eb9bc0d4a78e31fd55b23ced3907d67bc97d20c25547ec92176fb3f82a562ea582bda48793349a0620bfbf628215950686dc79581fe31b777c7e19d2e958f8d7cb6c41809a2528b4f768a328633c204eb13daf2de1b3440710663e35431a8bda4c63517e473bb1aff0254c254c +AD = 54e54327a4f7c7931e484002da710435132b0befa138717218db +CT = 0cc77597ce343e07976b706850b0eba884f7aea612249e2d5f08901adb2088d5babfbf8021003c3fff675c18c61cc7c3cc7e70a47942c0c241328aaf4b8df3edb5f42dc94b63c94cf6d71ffec027ea8c2ea3b5e22aa81ece6558612d4c64244d2cbc833d1d4d4c3f774ef2b7274ef00da3036f3ca02ca599f8271c55f1783230afee533bc0cbefead61ef3501896310a3d20142b3545ef8e18adde1b06e567b1fb8edc943b9ad1dbae31e747257f383d8c46eac6d57c0a57aea094e03d429e9eb1f61aaee6c78610bf54eb740a3fb1caf24ae3fa0023f8d9b7117cf1e8ce9bd510538427626897d9e90e6ca245fd5716a4056556c6b97f5f7b9b5b8c2b3854150676b9b5adf403b709aa671ee96c136e6e30cd39c4acf28055e89e2c0022c207e5803bde6557f8123ef768273acf200ebeb41dd0622013bd786f333c8f33d2f8e8f3f114304d405bb2b06e143c76b137e300444e215bd030f5c5d664bba409ffc23908cc367981d48c7df8abf9b482fe9d41beac1ae6efe0a106c2a211a5b453ab1d63d0c67fe0f05bb569cdae92302898a8ac760596690ed91148dbc549b7c719eca2bbca6d483aed042eb48b6bb0edcf9e01ad52940c5b564f96fa57ee4cf1f4816606f4026c4c459f5d53870876da387b925e2910badf148635c98e5f6e9cf2949d3634ef420424ecdb8c4ed3f7964ebad855f7da0ad001ee31ff846f94278637de1e59cbc80f4d231955c80dfbfeb4130ff7e1cae3909eac071b5aa7d5d305d883376772b3b1ecc959ba27b337cd4afafb61393481d2e894dc5d2dc7a1db030386292d919dd0c29556ea123f6e41760e7b585396b61c358db2a04bde2cfde1cc69270443a8f10d7a4f86c995a5829fbfa73d1594729ed718f89571912e66b0574a23f7d4a3583fe0e9b0130cccbb08d9ddb71d7c4700891394011325c2e4d9e0a937c1d34f6702d81c2254ec9e76fb0a7f4828c093d880451ded6bedf683d50423daabab981d8ca446bc0246fe2f897a8f0c0cb3c585acb9da8e6b1daf29ed3470314f8dc943dbb3a3deec20a088025058463e4418f037680e11849f52b1b229fba92c2d92a22ac4b67233d600398127a53ae31574f1d17463ebf5eb55f1185d1864bd5b030d2bf90192d2db4de72191489b133491846db2e36de12be858c31793f7f564fb67cd21b4bb937fb0d5a22df438990a009b10d09868bf98fdaa9944881185416484fb06b554000bace1e6df6e590b75e2124bfebb0a8a6644b90395bce8ed27acc90cdbc7e3349c2352c83bff383821a422f9e96ec3ba0593a31c7916c7deff89d1d9145a0b87a42f5bc00b57b1c5ea6b24271a2fe5d67572ff628fcad5b23235a0dbc6c632cf05f167993b95eed1323e007acea83e39ca642fc01990b5612fa3ce741b1c0c2652eae042bf915390f966a0e4668caaf2ec763752966f9d2b2c9792967544cbbc516e3dce18272937ff82429b057f83bf7a9679a7bc0bb2440ee899885249559e9e625d4f880400187d370183d51d0dc6e5b2542671263985deeff5d40087a27b94a3b860dc228a4bd5d15c03f8f9f1579cf915a7122b93fef2c288a120bbc13dc37a01a33054ee931284aba0e0a09a55bfaf7f7266869b5077f55926743a6008a77c27abc51aa0f04a109cfd3794ea8cdec7f8b4ba922bcd342272dd1b4a4c289885db1cb4f23f289b05b1c19ff542b0e70cd83a88962e04605088d77f72335d6d38ff3d3f19a35e4c38167c4aee4de3ee99 +TAG = 86f4edc50e582cfa5295547bf01768d0 +FAILS = WRONG_NONCE_LENGTH + +# 1326 bytes plain text, 24 bytes key size, 38 bytes nonce size, 22 bytes AAD size +KEY = f0e87737ef261bdda497a6ea7bd337a3e0a4c24755982367 +NONCE = 32ca7a7dca51622c9823245175c80455191c1c38f333924d2eaec0ddc96627a7104041e06abb +IN = df5702fea46c486ab645191a5e54180fb4513b574115436541edda79c50831764f8b983e833cff1a751cae64ed6f1f3eb08fed5ce47956c1b6cb91be7248aebf2b5cfb536d36e839dc078a58d2f0b47a083865624db201d8a3b15b09050b93c2933e6509afa9e94efbb66ba2cf0b91329b5b827d13c5cfece80077393cab7b058fdc61d0fc9057cce0f5429c34f894539fa00399b655af6100635006c456bcb545aa32230d2285b92d556cb2f3706978380c42e981ee0b2a152f4031cf2c0a75e5a542c22321f44d779f34e67f151141fdc306cd4bf9f16159688a2e9e85eef9c0d95203b9f24e09d6d80e6847a198d6d990114de01627a1b1e5a6bcc81b0aacd824e2777463fae8e39fe912fd4581eae08aded2dd190d622864d014ca636b32cb6f577a0afd0ec977350d568709e2178c3f466bc172157cf250be28017076c9601fbe960970cd5625c5a6974f1739860e371542bdb77fec614e590e26e661a27a6a36ac09de67bbb0a7380bd16ad44430e97bf130eaca3e267ba998d2d2e8289ac2bdae290e222e1f18b53e0a23fb2239ae1374ef14669a21c496e17fe82ef2bb5c940d6b611a15494c5b8cb2a9bd15ffa3f1a879317f884169691f2244b9813eebbf70f63d2636905d5c6847cb18779fb8ce10178bc6c02f9dd91c384b3d6e0df8d665fb74863e5af028d48b28fa37c70ffec085ba745c3cf3784fc726e19e4c382c7110b0a72fbc14eb9e35b6628e27fbf994dea24afd6e530f9754dd8c74f81d256e3e9e86cc83a9e10d2a0428b4517c708cec65cd62a6d43492274b9741ffb2871d313f2d82d4e96bda1a6b89e3177675a7cd12e1eff942f65f8ffca5ef17e5ccf04f1f224a48c71a2296a354b18bc3a8a06690f68f6a6516cb4b8b14760c8b815003de1399fcbe2ff96fa01e9adde3436dd527a15bab4187ee85ebd5c16f4158a168ec136d937afcf3b30eeb861f64e25c6b206034949c773ef71cd1ca8389f1f37dcd1f83894329200bb6d4657a5cb40e2559e75f67d0d1c11b483906fa33ac0b89bb909cb366821cfb313c027d1c0f38c12d43d89ee42060c7f107bd8e925e1aa612d9a816ab634183f4bdb7973da709989eb9875fd67b8a185d00d9ba7d0c501e6ebf3cd09a8cc5c9d1274331dc5954a2d2222a781d8c6f84342389d65b89607fe9863dcb53c63f1e0500b9b02f7da9769ea3b1108b75a31da7ace7196db471ae5398feb77e1fbd7211bfd2c1fcf4cdc67693d5ed6853180da6c2c46ef341c1501cfe784a2e3672c363b5af2af3776945a94a03988878b9cd0dd0069c2a72ae8d3f32ac2f923348e8b72a213ecddb164b88aa959f1242c4cfd646e8277e228d9a44795622f5366ec8e6856a7081d768186eeccecf6e24b9089ce1979d504afd58d84413f4d698e8fafedfe893a5f4758d4010ccffb3e4678113f264ad1705d964b3609fbef085c568cdefe155a1e39072e5515201e908992f76bbaba3f91870ed268ae46f0b53a0564eba8018c88f5e8ea73bd8f4c7dbfbd726bf41cf93a33b513e0d6ba71793e95c7e7570220d239815846ae532e8f8acb1bf1b8acd716e95b3fa7ea9eeeb2f88167d5c81205806e4a197489484be071af14f89b824f772e6f901dea5a268ab79d5dffd248d27be8740b373a5fce9e8f36186c365576df2f19321716bcc1ad1a17647f91c7d137f1f5064a28e8ed8ae628b0121f72980484693b3b480e4b9cc7c906883651f1c15eda60e938f746a64a830b4ac4975a8364d8f5c8236bb00f22b6dbecb0b9c789c7ec42adc9d012da9b6ee6eed52527fac1fed19d1ad1d7352fc8428d716219997f6171e9d2f2581a47c93e8e3c72b1151120ecc094dbcd4651b2794 +AD = f7582f9b76ec9f10ce552a69056674081f724e7e672e +CT = 1d66dc97da44e8b9739b57e5f0bebc18ecd11f047e46725caa86acea05838dd2944e7900c5f6f81f3c131fa6e0b512da1dc5ed24a6c8379601ae60a3b89f11cc4bec16991e819893a4d02a69b67581bea79eb77b6a9444bb7fc70fd704102b663ac0fba5a3ce13149afe0712fdbe6543e3d5904f578663195e9bdd745a8410f146c0edd7c13a6a4ee1daa3b583a6d8d0f32c6260a8a2106c7de29d4c40d4102ba2b32bd2bc11a49933a4538e2e6ba7c95050deb8894c6f9ba78a7c5ad83a8bd339d6ccb00a71afff8e4870720bd3e8f475d9afb046f237550c574b651bf7888880bfa377ca36efa59f6ed360c6df91f47da714e1966f92de6cbcca7b0d6dd6565e3b698bcc737a417b7f30493066baeec47c4a304a2c3c50b69b20a6d59753c81819fd74c5f72968052c1de8c7af79c37ccd7430518f1b91683be8cc0d2a789320ceae638d5a1a412ecc95725f1f6ed4c2b549f7f639f56aa68cfef588ba56648521ffaefc1447a04f6c70cd9dc292df7fa177be5f8df3fa0c1ae96df5db3b79c09489de65808f09b714476e35b8a607237be428c2facccc02eabd5b3d37ccd87c06f1095ce91af6869272ed40616afbcccb7cb67e9526ac2466ae669b78778d05f45336ad295e472945f0d39b8064f3496ee9d0b8dbc47ffddd1943a8da8fabd19d1e0d14d9955d59f38046526b5b8085d27da3588e18f39a0197d79bf2b1a666fd7c5b3422a312d5526ca9d212f70d0048d692fc3685758c1bcb9efb76491acfc0135cb41a79f76fdbde7e94151f40d568c9114289b1dcbd2d56f7d7ff17412e90ec39bef191dd84e50232c69e9e451f22cc43ee7558e5330d52b31e0ee83661dce16998efd61bb3caedbef7e817f2182f9d8df32f35180233d6b076193b8280c90bae16d819c85c114cc9b47aab4259344f3d7a2c63b222c1cadcbdc378fe55559f18316fa76cad1ff3ef12863933052015b56fbf0502f943976b4fcd53968253e405ffc17580818770ab56797c6e77c5cc7ad67118f522388a7ae828dc9bb0b02720b23e987bd82a9bdde9c7b5dc6d20a6b9833aa918419b8fb26bdebd69207c682ab66b400e29565945b3425be2d893e724a7f286f6085877a939e5f96221fe9bbda52a388981496a2ab6656f0128dd7f8748495be97e126a0a1cfba18edbef37549d5110ff7b2e9cc3bcaf3b9467c7eab9d5f6ff7843100f8c4d5fbf4df95a15ddebf593832651c247056ab48d20b8a3588ea9eaec37b36cfe55e43f29d4ebf2e730421259f92075a4920fc5a3644b2d425aa88c6f0b54e7126df4378a8d6c48b3477b3e28504642a43d280a7a6d86d64e543de393e334b1026d916e491524fa0c2ce0a3ffaa5b675e141ce140f3636ef949bc88380b7e550e1f2dd0a4c2e5b651bcff230e59d549442d6728037ff209abff760bb534c50ce3e2695076997e46204396892a0a130eb4d6bf2ebc1970dad77c49b43b38430f1b76f06eafdf649032d5e107d7b6ae04f2f713c7300b89144df282fc6f1bfa2f916f612ffe5e71681f6bc1c95503f5dba6d51533ba685a3f8146b95aa4660d3fc34dc9a3dcc9b6243dc7554ca63259d093f52022e545a144ee21b7440adc6e412cc6d9d0b4625cbd4fc9d496ede7b58ad7a024cb4fe3526aa4833d04af8fef0587cde42fb7cf424fe843339eec26643ed5db8b018024d19499f93c9a55d6f2b64da08686eeab0b4e616c305aa17af73faaf08f387b8caac750b8a4d90e049be74485c26ae26f8360f5d9040b1ef3e9b3f3343d7de0a0d1682baae058730d7e97843ea762745ed76ab8c26e7fe93e21c883d5d7ef9361f31d62daf7cc6c1ef76c0ceef54b3ec6bb0176db3398443c82e5d618fe +TAG = 557b7a2f5864b5958da789960c26c496 +FAILS = WRONG_NONCE_LENGTH + +# 1486 bytes plain text, 24 bytes key size, 22 bytes nonce size, 12 bytes AAD size +KEY = 93bbbc45840748357bd2c52d3efaa8538120f08386d1b94b +NONCE = a9b847adbc4c894f67f7ba50ca64493726194a637bb1 +IN = a074185ab3c7cffd447826b6c0a9ddabc09f803b334da18769ccc9ce15e63d94ba8e82fe6e32c777eb47d5dedd75d6f87f32b228677cf5f9d3e8833bf61253961de357775e39944aa05b4ecc791974780050d526369f92e79f76858c41d9ce20448e100097f65099f0d1b803d771c5432a543d0f03fd651160b005ae51128ab62d407fa1e358609b2ea68dee3570c97ab62fa812118451f10e1df48a928089da706b3e8442db21378b44978f0a9ee931a2fd74f5f081f8d624033d5ec0cbc46283570ea39351420eb01a093f0a92c1674deea828790f168c0aad95b73b185326ea4e3b86f663ca72fe73c3a3193ff00b2bfda5247462e6f2f9ea9a41ae0b61921b8eef8841611b1715f74294d7235b9580666283d9a546514dd71ca50dc5af3a8caf343d7b6f6e4373a85e0dad1a74cc9b0716a8427aee6e62f83927b32bae858f5731e171e8604718ec1139ff672592d5f4bf4fe6ed70002d5be5791681cc0613fa0b83e424f3335011bd1b01afaf7d9808d187bb025edf93783500bf58479440eae1cccf3449809913fbf752cd7ca7b41877469fec0153c88a20e4d88d7c295b0aa5983c2366a35970e8a9eadf1927e1b98ba331f39439cf1accb43564696ee7b7db9d0933c7e1491f425c9a33af76c6b799af93a427fa5fc26c3782bb90075986403e1ebb0dbe0569d35e7571a1099a2a053179d16e485e670297420235e78ba25b7eddac17c69130eb73b5fe52591ec3c760710541adae3d4461414133e1b8d302aaa037db45db5e685aaeab192376475025cfbfe0325c686eb16d98f486ea3401dfb1d632052e1afe36fddff01cb01219940bca08640922753a745313fdff11c1df9efc8e417c7130997d86def830507c91553543c3902bf4f53e8c76c8ca6680022cfc7ebed0178a0875ec8e339064f5749864281ff6927c0309479c28c148be215469486e6cc323bb50d505b6b7baedd25a08bb612a1ec4b748c10ac65b9577ab5706a7558d18b53a44038ec12d46dd4c49cf1aec09d23efaa85f654132197ece59d37d2b9f6d7c384320f42d7afebf329a01d75179ade962d697390d281a0e401de0bbebb0de20d4ac448ead66710f73252bc63a8903e6fe4c48664b052c8a52a82457377406692b3fb10ef6afe744507050e4308bf50210a3e9a072c17ddae2213b6ece738dcbb779b3516a4b7671bfd85e9f9471871ac611cb67e9070d5061decd26f5aabb0ea340d59b377eb2bbe7495841c8821c62adb7adcd8dcf42c054d0ad11d62a4ae69787764b3df22e87ec55c0fec50785dbfce8eae5e135faf92a61c068117322ea8f235aa52e8f9830e4dbbe5f39a1c58fd22eb1941b3867b72eceabad973cb593f192b258220509b116b85d20f2b8b73c1da8ddf5414d96a8601b11470a3645f78f2e6c80611261609d4c9a55cac90beb59c83883a8d3e54daba3ef2cf8ec80e860fa2bca17eb1c85bb2c9e3679b0a680744754b4caa2030eee3732cb838fd35e6fcd95dadc49234a8692420346ae52efd43d1b3f61540b84f722cfc87e1af335278312f3be053e2774698d9e11584b4e706002ac83ccc09f30d7a5005168fff9acb8ec3ca0636b118a0da9749ef77494c33d790ee0b85e0a0987ff6e6d456442b13da14ea213a8695aea41f0e8eeab2549535dc48fbe2c7ec92549a639d3aba40955021e9036f1d2d00ddfdf51e41e34bb0690538f7cd969adacd07290bbb0e4502ccf884685946cce0c0af58f513b8b467dcee42905b187b88648d55fb62972f8eae15c944c554210e1a25c433cd3583c82f1c55fdd8838946a5cd161342ae16bfafa320090aa47afa64733df797635b5948c3ae35ef4ab4f1b460ed673dcfe4edd2a43401c3bc34dbf14c4e4a67792e8a0ea7dfe5c2c9170e0276030c85d9e6c39c6e04bbd81161015ebb94ff47484130fde167173c1ea9cf83dbe4903518e8dffe65789911ec9d8ef1367c321ee176c907a6ee1cfa232d6fc4d04e66e76c5d0647f3065b1688de084b2e6da2280f9b012f8b3c0b6dd5cab4d710142557084b5d110d8e13bc9e6ea68a2cb6836ebab8f1989a365877aff591adf613e033478428433 +AD = d7dad5e0915be4923509bd65 +CT = dc15f22d5c5ad4962bf10aa6851a8b1d367357696a8d4814576b01b0682756cf4eda2bd270caeed933decc7372bdc2a60de0ac59745e4b6533f5f070ce1427f73c5a2ab35f6bd56908946e92be50844bede2953fae95a8e1c1a7fd6cc091d16d307abd9b49aca2765ed4f42f2269260f8e92973d8deffcba6c704b225d29824710821cca823fb04958d25ada1277f02df17c31b53b9f56a225b0e8083d10fafb07eaa751549b07c076fa346a41876e56c9ee7ecbf7c63053d9066625e799d18d71565dfd38b2c3493c935528bc0b9c41585e57108842564ac687560e818f05f23029c3faf613078ef3c873f2e89ecc465d4090181bc646075c162831e52f5352189621a533458be30e89e2db493b4c0a1f0237b767439eebf7b1f9aa83a3025033db05ca0f472dd84a514f9c42aab00604d81bb653a32970c3e2689a4d01512e1e78be3cb93860501887e2ee66b268df31485fa0ec72d046be7aa09dfc5ca1674b1dd1f42a5ce2e0bbe12adc68263d02a574ebe1f3f084c0cc5be6c81ed4b0996ad88f4839ea322a7b09c390d96cad219ed3764d37044f4d91800d76246185461cce63648a20e2e03f5b114817094dd9d2051de2823c509e13b2871f44fbaacc406b4066a475e4464ae9175dcb60873157d99509a261b3fff973afad36631d882a954ccc3306392e61b6af346f762d02e03f84c03806f099fcd1945fcd708652ea45fb39158742b5311b76ba993f8e16728533a7939aae67b3f85ca18605c31909f3277ae0d74f22ce9c2e7e4da6f2eedc86ea14a45bbeedc458fe5df28ebfb680f3141d3509794c95c7da18b26e9d8daed6be38fd7893370e509d011ee32eca31e3388295d9ebdae1df4838c6cc2a1350dc18c074f55b4b8eef7986c0494107ad5d7ddbf65074a404e38b24a34c46acb55881c4b3f2a0453b083ef1e2038be5f8273738dc373d31ed617a863211b881eb18fd427eaa657f9d4620fbe467e7cf7ffdd36adaf4d6cb55a81fa7286529c0ee2a823895a3af01b1a36b1f9b53512588ba178022741db22aee8258fc0e8669f229b94d80cc9e6e4785a930060d366401b47ad2218d16cfdb1f3ae432b4b4407cbd82d9e42bdb086c6620bebe2d09731ebe7f226d56dd403c915e8b58c47638f690b0c1fd327c0369ef0de66af4854682efb0a7118eb567e519a1b181685f16d56769f2a688e6dd2b081fd1e424758c8e47f6018729fcda3bc8cb1d1540b35af029f677ab8eeeb4863329d973a859d4b13521aa788ce823c3ff917544f00413def07428a7778ff5a80e1300c2f01ddec937bc01f8a067451e61eea9a7a57aef7de1d6394632a8c8f0156ea9c92b20b443b56d57fe97fc7fac96095f4df72d4f0535b9ecf9185af0402187ade2653defca48715979c4a80d1febc22cd5011604906a330a088c152d67f3369cae9217605b37550cf0d88442f9a8644089b9dc3971c8f54f775ed66178c24e5769e63c9459c3ca515392c5a06fdfcbec2843c77d2396e75cf0b7c9ee7a212a8f0ce3c6ef73771ddb36d86b1cb22daf5abeba6812986396e65b28f7a6c40449cb3778b9ec203a78e45c2e02658f14d3e42a1fc10227e1ce9799c5e84656a4af2055fb487375b8419f959554f7028c95b623dc9fe284913066f080db449b3abe0ac68b23a0460c7a833e606949ee4d6b3e9aa954c5c0f1429ca9fdc85d699490591fdbec8485146d8726709af03c2226f10bd07f5310935b6c17486097328b4a1b05e0b96ba500156d6887113790f25b1b6fc739503d50e6eb27375244c3836c4f94874823a0b998cdd18cb78288e37eb7794346e02ccd910fdd1d44c8189efd02d018feac6529259ef22b49752463d5c0d9989d082a2e27839fffad0ebb5799afb35d55e2d4d88d23867132c2c410f84c7005ff56c44a672d6cfd4f4f2f42f7b1b69797edec34345b7e82393c02a778da7ef3135ab8b7b8afcab8a18c8f628bd301746a2a645e9833cebeab907a907086dc0ef64d383a37278799be21c0118045787e7cd4fccc46a36290542eb54ba89e1cb10beec7c6714926cdc6ede2a933af01b27fa8db3d790735468247f5301a63b3f0 +TAG = 8016f20a55524cb88dbe3a6573db1ff9 +FAILS = WRONG_NONCE_LENGTH + +# 1567 bytes plain text, 24 bytes key size, 59 bytes nonce size, 10 bytes AAD size +KEY = c81c6f6da6f8c17cd5a42997ba3790a7dc38cfb536ebc18a +NONCE = 458e8ed8146ed763b1552a8582720c2a25931ea8d6b80c23cedee6793297e9801e35e930d3413d242b29f000589a015de283b5d4c23f0e5266b102 +IN = 8a0811f013ec1fc041efec018a0af6a0cf3ba92a601fa6da234cf02b4697c694fd47ad3e27fbd3085a98538f4cfb9178252afdccf85e5f212671cb04377b288a41294a21b3319c898f04ae075e5824e2ef5c397c5375ea65cc60c6acc05932f2cec8a396bd4fb0f60c5c67a30d7d7c7ff8104faa85f8e752b11d6f5a9de87597443a3f7423d371dfb711a7eb0e9d0acb590af29fd8d704a3349e7b392f87962e8805bb055871361f858bd7c4bd2d08c84a8e78c224ddf6c40858b7c80b14e7f24b51b46a5a417591254f552e2727fcf5c8ec13becdb037c9baeb164f44f72da2fcad6babd2a85db71f320e3b271d57267c12e6c2d4f7ec3629d3a48b1e90dab3942a89b2f89a5097796f1c054cb0de0017ae69b33a43795e55213c08d6095fdad52fd3bfbb381529cd9b4aebe0a2709c42ed57cbdbfd1f4480612c3e38ec12713b458f005940efee36b10390977d0919b721eade7c2968e211fc3625715271fdf2f22b6d2e50d5730cd722357cc4df06d1b7322977279e92a368e31a7da975ba85264cd479bdaeb10d4dfee6231f1091f179f381d4b30f9b7c3dd0a742a1ec9824849c43e41dc30abec6d974c511a002594c4b2cf3bd581373e2811893b81fce70aa61c6c81a35ce5b273a186a32c4d8c233e5d5b57da827b1e8670504edce81f99764ec16555634336482c47a3a1b59144fc890aea88d40d29e00ffe849e5621e93ee7c21a963538273bfbf9e522a9683725f332bca2318a86663751ba6e3f5e853c8f32b3e9a320db8e6bc9c9710766faaf365ac722704953f16882641fa4fd0c89322aac01d818b8eb2811e16fce11a3f9e1e2d763dbe7d84d526f216a8dff1699c30fe0bb957d63857b4980588816dae938caba75b207ebddada5823e4d6261b9a54af4b5729fd15d13bd65443a7b65a04ab6689fc8c92f67319c6221dcdd52183be629d3b016eb7a6ff377599f42bf50c573c55ce27fa27d240dc576feca7a2a987ad9bc845ee81cce7c8418545f9cd8d5824a45c34d825959685a78c5da7ebc94569448b407bd5550436734de55310054a316d2ab6682290921d37653db22eb5a0229c391bfcda86db2ddf5f6167aae2b6043432db3d82014897bfbd33e4d03411034e5e6180c3c045b73fb3f14538decf473365cc90c94071a280bd3b98ca090c881cd34c0dd9e13a4f829564b17b6ee33a724ae698b4d7444d9f8b446382f85b1a8bf6a50de0ee099ab2c9f2c871e3af05505082d4efaff8061466c27886c8cb10f5cad82684d39f35cc0c1fb273c24d37a014e2e68a9f21bfda48fa2fbcaf034d3af4fa1b7ab493cded39962e27e0dcb750d0a4e640e1aca968f684fd4066a7d1185799ae03f0b91001a9a5db422c42bb3085b7068aa49312dcefe255a3d776d099136449412e7ee5ca24ecfbf378166b1582b8ddceb2c1b98702fd5bff267b62ce9c2ab7bbc81da905e9d473b0f8e368e159aa749403f10e82cfeff34aa019b77a4514d71420a06dbba4271ac665b890c4eddb0755cd1312719ebf47c5230e07bdc84fba9632a65bcd62fcbd50d59c3e1c7beb899122fc11c3b7493c5ae6f07ffe8d9042d4ae75406eee6b7a4e52ef6c4bd864d25a70bd270b8a790b4f45ab41106991b52d098641b21d6c2a028d63d59d6a370633d34c3387929de08a9076df0b90df8494fc2b1739ce0510c3bdcf3f1b10a0dbbec2550232ec42dd9522b8452f055297cc3875f41fc46402e1a649ea2ab88a5e465c47dde3b85f9f906af714778c7fbcc98484c92e21911d9c88d2eebf8a8a5a081272fc586ddd4b8eb6924cbe9cf9fdf158b454df8e61d4b40737c07b47ba37f1e7b8ba4c52ba9ab903a88cfe9bedf07aff94bf4a42633f0ac4a93c97bae0bcae6384bf08c9660dadc41fb0fb9bb8ec0efb9b76f40a3760a10e457456c52fa2a63b5500b6d0ffb0347aefb17c289fb261a15769776d322a9c917d6c5c45b2f1ffdccd2da52406cab00f0e462fb48703c6181ce2830d34f2c9f3e282c3566cfa829b60eed54c68175ab8fa5a35d5daf40f27489708ddbe3831c50f571e1576db76fb1d722890d20b66f92a7bf23f695062aaaf1de5a111a33e8ded0c6877e8724fb098c92eb0d66ce6e0fdc4ef1b80f004622f038fbb6b33535e064f3802a0880d4f559b9561fb25fbcda6b2a622283390bcaa78f9fad1c31d47cf582dc184ae83cb71e718bb +AD = f8447f3ad3a76a0969af +CT = 545870093f1b5aaffcee457530e832216295a8287481f689087473337d3231f015dab088aa2d4ee241ee57847df17fb14fcf84c699d9da02ae39c5966d4093a3033c59107ca779087770aea5d771185a2eeecaad16cccb43fbf7aef25ded6589e91c960a00ef7de9162b934c9b4aa0559cd5112323d85aa9d846b37ae7f05f0c0c4e455e23f394822182da874bfa093de236c44cfeef2e09d185d83f4a10c7399a29af6a0a5dc3026b19221f4153442b3288add94a0ee27bf923dd5968335d48d0879529416d1f60afdbcd38d8e517ee1a42529b01070fd6e641d9bfc78b97f84f6999f18bb18d174e00841bf5506ee359915827ffc3a1fac3cb2e13ac16a530b616e01994d70c69b6bf5b4f57ba39ff74cc86f7996704744bd4256aa53b1bbf080aa7a07ade53a9a6fb51121eb3925cf3f54adc680561fab2a9c7d29d5257c57135ca5ad04dd5af2e66ff8989cf9406bd1dca39516efb20d049cd3889c6f5e7a008f10efa9ec5f2c01c6efeb983fde9af82904150e27ec38481332d8a89b4b428e8e3abb5c7fb48c0319afcecbe7db651beb771f68ab9a640db68e68723f9c9f4e804db8fdbdc487e097dea734e1c0cea2b3ccaa6156f29844491cd7e55c1f9ff5a032c6adf0e76ffa3f3379329c11fe8ddc53204452ed58d0a85fdc27500da56cc67bc315f91150f9481934b74adc6a3c09b3857e555db57f02efbbd30700ef5740c9d4b774301a8a30e1c859a2d2932162bc75aa20f770920ba0ea7be40d8e86fb18499c25c146e90385447bbd31cbea3de41d5f64d77b019d7ae42a898ef3d2c2ee63af1ae1561dec4c9e10f19829812e0755c3f7d5bab104976a5c8fd4343583b4a39dddb240f4e3f5f188788e01c30f761c1313c12f08d96adcbbb5fe13b80a3d34fd0c76099266aac08a94b719c4209748458c256672e082758d16d292569b15e6caac133a329c55fd85ab504781fe069548529a41afe4e85b1d2c2960538d7e76ee88b8d3a3c2f1abcecd799d3404f7286ff052626edc82a8ae3aa7e39c85b4b5ec594b0be4ec57af6c3efb08a5816a00b92cd74dd70065b14925f3fcd1ad8df25faa38aee7ddf0da6b3f83e8b10f5cd66ae51c7c3b8f8b27cda96f5be67aceb3a558623b0e47bf1d94cda0c759dfe51a68700362e714beb38366c98635be7ca929b979419a438fb95672246b5576514802b408c9eb7054a147f9c9dd3af7d0aecef941e7dab9a01e56b162f9041fb55c8c345d619d0b16d56e2c4badceab8135ef0c9db965242038da264199fd9a23e17c7ad580771c2106e003d6316dd7ee7481fa7d533cdfa8ae6bb87cb8b717c363d9f8a1eccb1bd51ab1ebb8f27891af18dd52515645711e6fc9018f9f81b5f3d8f78e0096bd6e3895a2c97810559bbe11ab09a7ca4845901c69423a550df9469417c0fb44d22fe26c63eef9f461de339a9c5291abaac88824cda21c1ca2c8a17c60277d5f568d98258903521245389c4a16fba6cd1060336d743926a6235d65bea49176d55abe65707fd95fa6a70162544f236eaafe0d3755efa51783f329323adbdf8d33a0d1bb4d432c3e536f91cc1b54cf360a0070f1ece99f548d9fe0819c29309c3fe19b8551c8819f5f5b5a2c8ffedc6d9799cb841d75ac07c7738ff1ad0c94ceb19193a9355bc36b8d6aac4b569a7058e72aaa5ff1d181f026ecb2697912595560d52fb0b3b7289b9d8e12b1e67b12cc43817faba814d052fd0dc16ee225a1ebf844fb9f2a524476fd078dbdaa2e977c8fd11b68be326d97b123470de0df5f6aaa38a64c5c59dfae0c09eed97ab614a5426a2e793ecdd6c8fca5b0ffd76e4c3e5ab9640459b0e83840ed9c9644d1ca89b0c3431ae2fb48e20c4f8a8e46a89ab450e6b6594eec53aa65af8a647bfa6f9f2c1bb92afb63056435f3ac75e20516048031622ed0a0475b20f6909b69338d00d9592d00c9906f2afe6c17a0369cd678118c6d415c572dbcd679c9dc065768772572142a154d8044846c8b2ba1638ba735b797b0b6d611a8fe6c0268c7bf8db2f46d73f43ab316239c77a5ee7af1a6338bfd90648b7a756dc3f2b6a38bc1c8bf9f2897e4d5c8997c49e3f7d3cc750081e18f00a9cff8035e3d1c19166b456037f8d1e05e21fadb870b349734a4ed3b5deb428fbaed27d1b0a7333de1778ea342bd563d8586f95d4bb5406253c5e216faf5fb8b1e61df78a +TAG = 0e39440245fabb319e5b6f610593b7c9 +FAILS = WRONG_NONCE_LENGTH + +# 1732 bytes plain text, 24 bytes key size, 7 bytes nonce size, 19 bytes AAD size +KEY = eca3aa66bd0747e5bb0ee18690148757711acf8f40ed6505 +NONCE = 91a1e0f9b0594c +IN = c02e90b8c95ca2a555ee2b3dc5515a068a04e08f3933885942a71f9acd66f8e7eab5c3b6ed759a3cc5469e45b6d4a7307e632db5f20248391b07033e792507a7c5a13abce86e4ebec27d9accfeb82a40e03cb0044c53739cf581e3fa0c843de11a8ea0ff355445ff05fc89a1270237cb964f315ea64d7da6b11f45c4e27d54058dff7e6b923d2a8fe80956e5ff7a0202a040c13b73f6e3171b6a11dac6cdb981144c4dbaf577c6b100b868dcfea943e2bce2e30832e3c53625388f9c4c3979cd541b9a75a79d7fbb7512c71a5c618651b0100214a72a2840f47a7b01c1043b92285f856faf863f3ea9e6df429836ec6567c58a23784e9dc70d181d837d70fba980b9241fc178fbbf2f63be8447434fa98dd95c82e3d70c96041aa943df1b389ec3e60114f50e9a1c2e63a284f7926c6d17f62d9625161fdf9ab4dabe34e556e407b382a5024d8e04a58e08c663117daffc665e776011b64140c9ccb1bc9b48afa881018fa37841eb8ef9c8075c7eeffa8d433d665e351db11b44fe4c468079788b262b6c62d0bf6ced065ac3e90163d2a8a2db8e63794508e2c0f7312191ea35d705efe98298b17c3c8859a7c9aa080b4c8429e7235544f16b156c347f997759c8fa87943220313ac2cb214c743af87f917b48ca6c4fe4d14b0ebf8c1a79ade5dd387b8ddfc387ed48604ad6ca47191d24f5db2ef7aa2b8152fd500dc935a5be22df59dbe25989d43422dee47fc8333496784e86280ad3d663e6ce8280c6116b55e0aba2d43d8e4177c01d257c29060d257334e3550b4a27bc8bb29d364db67c09a8253139e449a26482f8c4d4fffb200ee3542da541860286b35bec7a9ee7d1962517452c3000b115aa20029108a2ef4bc18e682940c361216ceefee2fbbd21ced315d82c5d00a5c54da98c1fb12649e70721d9105987eb7029bbc14914cd1e4bb5abd0ba9c509c51527cbc9bc53baaeec967e49288f8642bab17104e10eccbab830fb703039845ca3c6ab6a1c8a67917864856256ba390622ad3a65863bb177f47d24ecfca5efdfee7e1f59cca2e1f8ee2b4db1f570e817bf6e4b7d3284c6ad8ff63af60dd8476510776e96c1167291796a7d4a8c3d65d18a5f11e5c37a707db994948c43e1fdc8efef6d37341424b035dba509f1d394592eedff66ab9e501b498a2d96416fded7912665a29ca415a347d099bea377c5ab27ecc84410c0fdba40a77bedb8b323f777c3978dd6e85c86c5e31153c36ae20374df24a12d5938c9a96a8ad6a2ac64ca756bfaf6bf683e09e69aedea224f29327d977165511280b8c9651d52a14abd0d7a1bbbd31bd9e202f47201fb08ebd121b33483f46156d0cc7f180a2287054dc8e0b21e4757f32fd422990aaf2374ca8dc95b76c002af095de4c597abed0c2fcde80f059b16a19c0f2623d793a80a3b213d13a05a52c4d40f2ecd902190ff138365677f88898da39005e8c6b8e18ad7ecf84dc47468677a8ae8d9697a61980084501cc44847a88ac2f9c5b3747a107ac3c208bbe39ab31c5c10052bae39197355e9ec3a6a1e1e9e2a15e16e07213a103b57c9469613b11308546f912e54553a20f5f83d7ad197e3e3f024715177578aa927f3e949af46b1700a66ae0fdc713a4ba7b3f64c3194090de1272ea57765b221bd85571f79f744ac456a9c4b9af2435f6210720fe02401a3d55092e4410de3fa7ccbc3a98191e56d832aaf024b8dff1c33069f4ceadd0d64602d6306d894572e3cb51923f36e6199eaff2d516668db8be17885552ac94d3becc62dc1a6d047efad1f71f90249b07954c5c47f5f6622a7122152a95a32944844d18f460f84e1c11452d43aa78de66b9bc93d68803a4a53c9f1fc3a151ddd8c6a9a89a59388cde7cc8177f6284a3f7bd1e01dd6f1ef17c2fd666edf4b2cbec68633c00ec3ff8295ef24a3476bf5de1cc8e6c8e28436b894dd8ff65c9dcddfdf186f788b0eba9d857feecf97a54f2de45c9032c30c0d96de64cc2c8c77cb0529b23d22fe8b338fb20a0d7ed3781d13b2f448e7fc9f70bf8bb537436816f2e5877a0c08f3237710b279785ce928abf115a851503e5fa21164c451ed000be5c510511c6592910c2bacf6ccb943e0773ad335789c7fae9085c95b82f10f543d75802eea5beccfe0770accbe7f57e2c0dc2a5e99f6481a2f76d74c38c62ceb39e9b87b4ab1b3a7eab176e2cd91f2e2c95f41ba63844fd291a7d18d2786135a0e6f32a7198510c1f0edc4401279c0fdfc33814546eeeeb8161b24a00ebe914a38cab6de031b751e0d3044f5a8c4283f79ff1d0fed5d6bc87017f7fed885e6246c12dd4eaaea668ff47039f59584e28f1d2ed2e1b61d6d9aca56644f835915e9f029dd8ed2a86798da9be4b3f433978e2e0998a34325103bf4ea53f0c4cf4f289c226ed766586f4c45bf7d996ca113ad1af03bab0abf3 +AD = 46f91522c964f85e2b93b8836699ea55c5ce08 +CT = 332d5653324536b24c4cab2a7c0f45a9ba2b34306644ecbc17dcee0d3e9ec7e95964db322d7c9ec0e887f1e97f253191fddeed4b9e3392a57b0dd07d8b7bf741468994692fb651aa980aecadfa4ebd296453d03fd77c1f2da52f41356b3bac19adef44965c9e3c2f880735887bd09e0df0919ae7302b9279ecd68df392799f143dcfb0aa9d27f5ceb8373d920396b8dace12e512cd1b8980251a1c8c83062461f5feed0c28a64a997da30e938496d913dc3a2d84b4a10fc13833707eaf52f642df27c827ad1136d739433ee0a7e065b9beee34a875e593c6b5c12d6079457d49ab7051b7ce7f47265858b1e6895e6bd11944e0c6ac28763979126b6363a600f0c86867717f3f544bd1f62a64adc6297450ea36186054fabcd1f32ae879e8344074ba7d5df451fec542b8b15035686fc746bbd52ae25809d201b95d2c567049eb8d90bfa9ec1a0616dbafe1bf19019f5e4046ff8712fda7d662af27e972f17fc1df5751b56782d37dbf964c1b914d3c5d96d68fa61b8d711c15bb51dba2f279f7ac1dccc62a0a8c502e3fd9cd372ba7f09b7cbdc2088510f7061001cfe5326dae815125069a4ebda47643f4e4b9cde452570326bafb424fd874a6634d44eb7fd7d6f6f450e0a10270413d3f2f55bf55542d49dc6b6af312db68595451450b2696f82310960c9e9f2dba95e0fd597c22b13b7edb5757b200a73cf5c0c45f859a373fbb331afd8f7fff82e112f5292ee70ecf57791ae6ead53afbdd44bd783bc2609ec78fa8735b88a923b1a997c792b565129d5a01264cf9cab9f7217ba88a5133f8e5cde687f6c3df3acdb4153b2232853b20291091251496761bc147bc2c523aac29f56b334bfa08d135ec76fac200a8f016447f1f3151ba330c98a7e47bf9eac5ae7412dea78cb2bd0c89134659a23dfd91c6cfb1d20adaae0b776ebdac60d24ee448e8305a8661f55d0cbad9c163c8c80abf1df5fec07e2ace5a00ac0d8e7897dfec3b95e025e235cb7023486e157611890e0f63b155fc31112c210c89246032591c2c6ff5ce72ad71dba8dd56d330d9e6a4cebec6a023f881accd8392e9d5968f95fe99ef17aaa47e6ae6a49ee4f46c1a1c364c958fc4416974165fb2455d641d3592639ec68f2c3c901af2af2c59ecd5aacdab139ffc70623fe9363d1a636195c743c2a655ef303d38e924ed944779aef14122cfa056dab21b3383adc8eab15ef58b86cdc6e7518dcfc7ebf69658ca1f6229453048162f13f0b719e2bd4513f2a098965030e1bc7b32adb5eaf32fbdbf6c8b680180efa59b26b3054c3cb2aeb1fa89248502dd8430ea53d845f3a3883de78650b6c68c071a862731a2f95f24c0cb2be782d99808ea1f947c3a1f5d6ea90452938eb3ad4583242da2b365d9859f522099154b79aefed4912b954e738d29d78269e8746f477119c6e24fba7331e723579b85c4e11297b7878529bb3b4f7e7e34837e83600ae827814e7fe4ea71cde15c0ec55492e98f001dc39d36738f57f18ae3ee13ee60148778fe9b959c6f6288c51be82366b67c086ebecbb8a96ef64a639d37a8fe78c896d0229011863e2b9855291d23c138c9a8b5e495ba318a6403565c891260efb692dc5904600ce64ebd241c4f8e023a91595f7cfa423791143472758398da670e5f46da0badd4693ffd56ccd08837bdbf089bfb33b1a7588aa06deeeedcd7608c22f7b42cfbc955862831381ac4ab048bd567b70de489e159ec848abb54ca3d472053045bbe8c66a2102be70ac6604265c57dc91ddee88ad3739ad37ab0c37000ab66213a053412353b1e20cf84e240286a6c463cadfdcd9740bbbc2c9acd7ef34bc29ef273c1f763fbdab8d2348ceff10e6dd07f6a543a19c1b158d069d2fe1393ff68a5e524e4bdff459c81bad0e18cb73ed3e12f3a2c09dc01887d948020df544c3b67459380d011c2cae930db5d03edfb596fc8d7cdbe1772f1533c9ef8e880bfcc358a3fcf1c05c3372050c740bc1e0793d44e20065980e66fe30787bec7096a454c07886806d4f38c8c7570c9444fc6e4028592ae2cd24ac6b43328f6e701851521282b7d8825788355f2bbb93b027c8617a0244e4a2d824fd106cbd85f30279251980fb624ad35432ae1304f84ea443ff0959cf1e46a2f23a54a67f1431aac836cd40e5edd6fb938fbff1285c5195cfebbd781563a05a9105fc7c07d5914fda61a5d5a31d36b17425a1b91ec67d62b583dce521aa8ffba44e5302e659cea090730d447418ac9fd1dfbca7d5112650bc077c2187873da6340ac2ea756d361e22a3d215ac0212db6444948cfde2c328ebe2a360225632da2cbfcf775b3bb8078ef60c1288921e9105ac45da77f9ef81cdc00fa9386bf3a197650941c2b9b6fa58a3e9557f5ece04f79c36c19237673a87d3e0a00f239700f4d98ecee923b44019b67128210ff189e +TAG = 88e257504947097a5541228d4ee36814 +FAILS = WRONG_NONCE_LENGTH + +# 1821 bytes plain text, 24 bytes key size, 35 bytes nonce size, 22 bytes AAD size +KEY = 922b23a9096ae36262b54318c87ece851ff387c72d681e07 +NONCE = 07335fece072003dff5c7e867b4026db3c1072c396d9d300554261fa5777bb1d2c4a5b +IN = facd8ec5e651ae2c3185f7b3aa9218da190343b58b833efbbec47ac1743a123c212cfea5fe37e541abf52b0c7d4b6eead3c49d31ae3fa13433bb5281fe2ce81b83a79655da102e56545e87152f089eb37ad12e43f8c097eb364a72f691179513cfae03ccc286c33c136339c9610ffa98fb7094a4622f3f627d8deec2bdb83e3a43294e61c96be33aea1695a28c5fca3b070368a4caacbc6f73c56f992a35e7c4b5405570f96ad2f43c46ccacc9a9639075091de08b10233c0a188d0207ea5aff5f852b841ae71173338487e92f9128d7b86fd59cda1257be929bea6873038f5a05d1b651e19c28d37b4af5a28af3abcbff90f6d6f4e2e286e879b5352464db09459f50acb20f3298ec69e1e3d8e7b9e740ae4b96c518bb0544c3cb3e43c92d4ba6e79ad8e50624eea37764cfc75df0ab00f24017fe80d513b0b38694a01b6b51ff360a0a4359fda9e7f5345956611108938594627116170f51502275017254eaa0212529d0a836f0ff670ff21207134d435597af81db7e673e07659af4b340f630a536fd80dbdcbeb67e625059a5f9bd9355deb3c768575577df705ea3cee0cd3e307c3aea7c478929da8b3d80a591439ddefbf07a7866504862d6c2fc0f19b027495c111770aa1d723f98497077bebe926469d829958eebaecece711106233fff8679551a2b6388e01a0413d53f8f8f399b09b28ecdcf84f8d6e0c5055470647f7508e6078c37de3461a8cddfdc14006f5d4cfb7000f33834c30a2775d5f86b161f947e2770c24c962f0614881c5d450b6173be7cb743db06fb19101ce48f873056aec290f03124fd3e1fc7c78ff4097eb921fe3ef16306207eb8d9d875bf354ae34fc6b89edc8ac597853923f124018ee4e609670338619d17ac08d25bd7676c39f71aa11e91a7d0767e1241a5df46f20f8926dc44de8e023ac089ea2a063c490cc7d4c585783e487537d36188d93747581893de7de9bda513c6b2faf7e9c8f5ced7c2ea606b2748c3038614d3aa4a1d9dba68cbc26fe6433b07138aa32e52a36ac75167764f78430ad9f450b63b71a78b1b40d898615e3c69a7d13b4fc3d3db9eda75bdb94080422ea3e2cd9145893788a3d47965b1685779e4d4af90e72c32f7e506274467558c28dbde631b372656a5a9c936c051dd31a193c4af40b25f1aac0345adfd5f9057312fbefd0f4668d793f5f6daeaad76cc391addbfc6077c132cb5ba33004dfd558637fe908b029e586eca96a30148a2e5f0632d950c1d304f806ff64ee4912bc1e2310177f9ac06fa165f4c20470d319a80302a47b4136dcd75f81b7915f9521334fbe9d24023b62c84a0aad3fab035fc7e23351fd5a1a19504b85c9b7eb4dce67fefc1776b4f481dbca39955c029a717ac9da01b0626146d758e9adcd42d2803e2de6aea7fea36fd2b1ca0ca80409a8f7ac923c8e663e5c85e1db51f35bbf30f5858209a2ab28b95becf9d21ccad6052508afc00cb3cd507aee77e10b4a5d6acb31dfd9eae0943a2476878a247eb8e7b40fbbb3c875d4d63a3be77e9aa917cc4237dd626d0dfba975366b335f702db293f615b95eb08f86c811d896115f740ad0fc02909265b653e2eae8445c2134fa01d6a7801a2f7ea228a600ddeaffae01f5f63d067aa6d1e5176798e32a937a94671118cce95be808033e1195c4d3a124e5df424be587fbeb38ac482292ac4a1b6e1c9fef327ede9e3323be2e6e3ae109979746b6d95dd39437de1f42268882a7fc2b9b875ed6b8794b6eed2c5307b018f72e2e5b824af498e62011d8041dfb0b9874adf136eb70ca6056d50e03372617fb1b2b154e6dd04264962bd516ff9cbfb2c2f8f3eb9e07f3478050d849fa7430c09fcecc78ae9835d0d98249b47db07db393d5d1d8065a80d0fa5883f3fe14bf14e6045eb80035b675dd91cc5921b513d48e9b7f2b964a9847b11f21979273e6cc71f0375b257fcab943e7bd8e1d805f6f1d58433ca33c35b122d356d5f80832ea2ee50ff73a827db2323a11462aac438a5a748b55905a8552798151abd34555f2eb0a576dd38f1719914b5e529bd8b7bf2e41a712d27c29977d0e2cd79efc56e113e0e20360b515ec1c35dc41020f0ee39c845d368b8a67242490623312021f271047293fbf8eadc2d3051df46f81d81194d240bacb46fa337746a477238d97721ab3bccfa9fa5c6f8805868f4afecd3bb47cc425d7807a2b1ed4869585412af7e2743f303c8c2f4804497728d94585905975df1b596bcb89de114da34ce4588f4976b296c2087fde1270595024a3bd8123f93c1d75d71bcaecc20489370595aca440e54cf1a6c054959144b7b60b13d190987ba7f29ec1e4a0ab15066d48353a8e1bc96eecb0d2a6be8c7612a0067a2fc7862db2822ad0e2b63f3f696c803d81db2bbd05a9445bcfa14289645c946b03ed1f24c9962326e2e4905daa904969ebdcab281c67cd71d737df670c141cdb6e46abfe464cf5d4a4b42615fd2d0aaa7d1562badce5c2b5692006fe24c84c2ccaf29e1f403280b18645125f424682ce98b72500ee7af23fd5521befbe565f8acd18b5ece +AD = 2400bc1491d4a57505b3c0d67235fc54ee761cfdda0f +CT = 92d232b20183f22b36c23a4e066ad6f8dd12e582e70ff1f3e662dc54213c922f6f2a6fd9ce34649bdb66626bd940576ee4aa74edecfb8711f3b6942d15017fe40efae897a2ec073839148b03d5a20a533ff7fc127d1a9bc7961cdead51cbb157f4bb1b32972b51b7679572c7be3f22c1b7d3db8cf7381c703bd62ea1a0a4fa6097f2fea786eb11e9d2da3814c18301ef0ba1b9a63603ad95ec0d805381cbb2a9a10c0cedb5ee482e5c9439f549e22aa1defe40ac7f5f86df98ec5e407628b2284db07a9e362aac886ec0d036b0a8bef935665c08ebf36d11eea2b38eb9f004b41cd8518f2134d6013ad6755d5742a35a4c21c1295ae8945776524a143b4bd83adb892cfde590b654dfa628dc9110526d3f82edf7e501ed914020cb1ae79c5f08e0eeef7bd2820fef954306c27b98f2971469f3f37700e2198088d99b54dedea82f833e4d3ace46083646c9c0ddea98663dce7b5aa84678702c3700c7d819b07d9deb4cea838d0025557f394b6423a6863417510f5e1eb644494e1aef9f41f0f70f69477641cd8a38cdbafb1037d8fd989ae8b2b542b134362c13b6fa7713ccd56a6f37e1a3e696c1fdf980b8abd8a9f53d7da4e406fcef52f35cb7ad87121e9b6e1cd41762c14ebb8c49f5f3cdd129ff3225df0c798361c6a293189ab1ca01edf4a57166b260ac9acb255c961ed9d83590dd8e9d4b51d41e083cfde469f19b06868f53b0692568b9c2d1968b1f2523cf703b8a11e458bcf6db1d9bd0ce9738592e1279cd9274815040ebfe4e1343e303d1c56f7a20cfa3d5ccc868ec74b66d6e8363814f8d1c02a07c1e252cbd308f8186176a4729cef4f09d0473fe5098948c9d849ee8546d403e07441e95e948e5626d171507586d4dc9158c41771f96a490b73f3144669b54146733e98136d59ecd0285254ad025ee1415894ce12ee79f49407c55aa8772cf8b147c6d6ddff64ae2ca7a3e87c7ef314eeddb8dcf62f19e906e4af73f6bea076f819b72a349d5d52accb68d5f601bc1570c106f515800ccab83b077783d8c25fdfd750b1fe14452fd4c6b2add7418fdf5390848ff138b23f07e49008b466c82443609d4399cfd8fe46374a341f24f20450f3dad2692109000966f72a2bc63dc11d6a365a7ca200cdb1236cb047ab2a59b4efba0d49a56665c00e7eb34ded8dcf6194f2a5b960828be1f91487d61bef227ecf56bf48969ace5ce7cd6b653d8a96805ad9d953231659a3fc3b32a28563f95a30f22d63100ef67e367bb6bc1e4a4516f3db1beb7d264563bb64df71c493d3f53af2ebe640578decb72d150b82ef0dea2beb2282434c3c74e633be18ac1b4ed503bc9f218c7937aca5777d14e55fbc511b5133e8f0c11c924661b976f519aed3a0a2a9006ed138e91b75b5b775e24053effe5826058bea02422b5305f93526242e2312862f9bcc537467408ceb97d3ea1ecbec8f389b0b9ffe617f620c904cfb6f63ea1c27e30c8287ae0dcc7f3098591a161176cd36bfe6220813eec8304a2dca9adfab072ab08e2cbe17c6f5498e96e28a97d3b38267c8c0dcef51562720c0ed857e779e2f32638918a7535b7740524a43bb040d04c736748fc9e6ef6b5331fa6bb582d4d442610d33546016b660b3e67e0919f542b2ee139598d8a0ac1e9b93871b3013e0671cd6e88a8e598b97c449c87f4fe2469954fac21c792f32582c7bae587a5a6ee52821134fa368702a000ccd282f0dcc007ed89e6a8d3c2cc2166c39bac12b376e19abcefc83aeb4f799aee5e2c1a63f7cd3bcb0a68065293d41bba357ef6a8b5506257a9b0c5d431e72a108f0bf8f2640c135abcc4561290394b5135b3d33273da0fecf10ae8970a51212e0ebbe7d5e11075b35ecdd1493bb66d01aedd1dcbc4e379ac66ecb4b3362755988dae219059e9dec0799402423f849d5de9d2622eaabb52339a450350d812671d0ced3c49a1706c83ce0cc60df2e3ac6d6c63b91b5f9f0ab2bbfe06d16440042e94a3b456eb60c1688ee82c24431d3656001bf9b2585ea2141521de159e48a8a789250431bedb309313d6bd6fa45f2c85496e72c51f4b796691f016f53cead6e82ba8e67a3d14e5d35b1f1b7795a4b42083db4ddcaeff571b82980a3a3324bb71b3a91a5c7593e52424719654f4c2e4adf86980f92181293e93c49ebb44644799da8a6f913b54b1071cf9399ad718d969515ae8a2592763c24703579a2a4390e340e690c6d45000cbf30e5e277d9c7b7023b40ca4e9de02d1921b20f802fd99f736b1a443bfa608693719ef531bf6affb6f3b4a25f4574944e2c64b64f476661ee49cd5961459fdceeb398cef14b20e24be8d2232ad701a8845ff1ca7269612d6a0624a52cfdc19a06cffa619afe0d612a497aa101fb37c02d58b31087b54def7ab1934f96d473fafd307b48cc58b019c82fbf9aad2f524747fc0017d1feb9aa78593255e90b85787364d5ddf7ad573bf60c65b554c2c9f46113eea89bbe9368cfe95e146d906793d275c75f32cfca750c1bb984e7ce62334ef02e94b9600f9c0c94f7d4a26823885d6f3430d0e89c2ebd3e377 +TAG = 808e56ce47337f178688e05dee53e697 +FAILS = WRONG_NONCE_LENGTH + +# 2149 bytes plain text, 24 bytes key size, 15 bytes nonce size, 23 bytes AAD size +KEY = 1dda4f4ec655dea272ec539aca13c912243dc9319886e60c +NONCE = b1bc65ee00aaad59c98d99d1ffbee6 +IN = 1b5b101a1e21c4fd89a1750c4bf8eec3b8d2da0e270f41f17fd67a98f0ab6e32fe0628a7009090b3aa6515c4953cfa92b2d20bda1b7ac37a92a88fc0f2b3d6105f40cb91d4db8f334e84c214d2dbb5b4528a55a731d6c26e124ee08ebb44b5dabfa86716bb6e4c3ca37bc7e99ce40003d22f790a817dbe543c6994ba39de6dd1569c02c9a69dfd2b51e12992ea88969cf2142154efb4b1c12a4e7887099f17bca6441ac6b351aac18d57cc24b99ed4affc782c472e417da87a3836ce6427c2615413b9568828bbdca90d980f30f7192890d5693cdbce98cdb2eececa0bf382b97ee9ae59f5bd2544d29cc190ca7efc14808a5ea2a1de0a3d4ee0b906f6b4080ff2f9698a0ba21c2d14eca831aae144899e9eeb7c33ebc57756ddda99bad76b2f2b975d97562a9c99830b34e5c0888e8b36f40518a6d5ed6c9b51874a91b336b8f8b380c3273100f6e77ea771d83847aa94c46388efa5c2a27271b1a29688ca59ca11696789aa27c34bea7f8d3fc1c63bd4bb54cad9e8776c576cb7aad714a396452db819d5a0c0dbe29f1563058b3aa6fd57f42d1e838041558377e0673ea3de7af859d6ae80b6e1cfc911ad6218f4040eb2d1949c7d0f30fc331824ecdf7e9d6a8524af39e9d77ed3c5db6be07ea5ccff07237bfcdbb030b4a4d2e205165f80c7ee6d0f3777477ee6993b287d6d75e4160196ecb2bb6ab7ab17ae469df96bd9a97b986eef466e3c76bd49f548d1fa69532c64b5c4eef2a7dd01eb3143929c97d04ebfade796230f25e2d5bb30b5df899719d0d679d9f68a8e65963fbe8a8d5f6900e57410a9a5da2cdfee9c03475f0e19ca21d164d939b7f9af52598ae800531b946b47195b3a81d67de1dd99156ac25b5df8fc0a1af549fdc7fac67cb86f6b65c343d6353700b6d9b3660c9bba6b8635ad44d22bc1ecc84c1b62be938169a9c3403900d1cc28fc68b5dd09e6923a392ba7ef928970e65cfd4382c294962f2b23df9cbad8c96da4a8eadee0080230d9b767478d8fc45b4adfe59eb181e3a6a331d0a616dc53e6f885a282662b7fbba3860057b0bb14b4505604766191a31c23d4ce57182694953cb0f33731bc4fb45b2940a8b32ff50e1ee736bbf86ed8a20cf7b40441d611e125dfac002a3e3ccbc17be51e32a63f1895018054194259bae527e0707a2652304c018478e118ba0a9757952731679dbc1b24233ce80003fb9038a52f7c89841504a7d574614f52e48b580e5a79c6faef904fc07db7b95a23471be21624257594c23e5b0f606fe172929a52e0fc4ee6e7aa4ab96843ccb7820b294d595d84e087e9cffe6559eab9b8af8d84d0d64bad29b33af44c3fb1b04c4b933342dd9cf06ced375ad814a96a4e75f168f6a51c402940d8bfdcb6652d9327f39cc6aae805a106394a40dda66b3a7440d9617943cc7ba2a6dc84571d884352660fe451f47c77ea128db8fd2349703151c35c824e3619f5e7ef9d4da5ec6caa7590b5df21335acb1fec7d5bdbcce702ad0df55354f7770ef67eacd80f699ad6e51e3ebc66219d85ec5cdbff73bb62c71730817f5476f9fdf41a68fa69ee1e740888eac6d0b455666197d3ca727536e3db86e43075f9e8a4bc79d35ae5167efedaf11a3fac064f857917a7a23b55d2dc1b8778fc65e8c2f5c9f31e48f6574360220fdcec6740764f99d7b6afea82bc958c4482179dd3e88cadf2817660ba14e71ce60aa3a8e29e2b0ab78eb2ab148d72058c264d06a2c927d53fd7885ded0aa094efdb2b159411a9bdf65f4999517b2433bb178ba7e161c83494bde3d4e9f568820ee1c56428d5d22c2bb57ca34a185fa82abb34143350248fc264d28a9a835cb23cac388bfb203dc4174a6d0fa219c823e61b7433ae43e0839c0b525d9b037c9536db3ae425957b6efaef8c66bc9a815067dc978f439df5a572774eccc8e3f2a37376279b90937ee5174abb46c17e095280d3555a00bf8415ca24814d3119d07349b965b9d1e34f42b8570e4e94eb04f94cdda737e1b467714dba5a0064e901d47848f223779541dbe51e572a6c8ea7fed86734223b7399a3ac027665aa157950eb4dadb45be919dcb11c7a8ba9870089f92ed27274e27e1c6370f0cbd7009ed979672e0496dc8f092c6e7776bae02d3ecb2fcbfbf63386d7435900505d5ff7998da287386abbfaad7f7922e81560a20f00812209e3eb2d8e26bc7e1609cb99521339048fa4ee86ea8305c64a7f1d1f73e8bd06d827a6d5096972917c2ae68e89c56a274cd81c815cfd2284ddacd4a159e74b9af46b5daba31a788ae77ad3c78d8e0ca7406970a253bbaa1f8af586a48da6a7135d41edbe37b80974c9a79acef823f22ce15567ff8ec0ad05e2b5f779e18197e62198c33c6c01e76b5e29bfb4546df3e8249e7ccfcb509dce9620525dca1e643f6364f08ba66110557ce296152018d5b28e901f13a9ec4f61a049f23a64f4e9184fca2974210a0bcf0ac89fddc8c8704e0de582d66601505b767a2a89cf0ce3d52cdd873294905201f2c7ad7a6c3edf7ef84ee309a3edd25a86d449f7b3ae0eb780a80b0336636e0f3ac7e4871c736e605f015c6dec8702fd22229dad244a78bc81bfc6334b3686e6748c1161411a8e0b124b0fd8d7eb92e678d12854a75f72be547eebf39cd1f0b9620580105bb27d9319c99a141cac2804c227902e485763c74c78477c71feaf510470af72ca8a562db13ab30165b3a92bd5177b24b02bc0c9661c405ad185f2743c58fbdd28728b2c8213c146cb6f7a991fef87be35a70140824a93508f72635de8390a9fac55f0ad5e313bffbaba599327617dabcb84c5c825f16df4f8d64c2aeb28c00ab65f9e5b2fd9d0847bceeb1188ecb1fd547340cccbfe1f0bf265082eb393e4bdec93a3e6d6484f619ce732d6c83dce672160f5969f30ff93e6a2fa979bafc9f73377915bf54cfc05572bd793a6307df91a27ae3354fee50019152e8512ddac577e754025709b4a3e4027b2f8d0d8cd91003e886d5ba6f380896a190ab80477f600e81c4fea +AD = af7a8db45f25b68b733ce436787bda194eb1a6bf7bd51f +CT = 43564f082e5984f9b774739fbd7a676d98f6e6ca886128dc189c7e66ff1f28765f83b2ee486894461abc3d6c1fbbd0b21ae2db7d61e34620345dbf49f3cfc19ff9b235fba0eee6d663402d972e62019db4a990d491eb8108dcd926c612e135fdf49a162809875a3936b2f2aca0aabfa5edcc3259367232c2072c7c8b8575b3a703c78ae5d6f93335a43c660834df8dc3744b9cf1af452ac33136efdc4ca773f4b84fc456928b6227555f0afb5f1f4ea5fb42bc2a24f2e9a8d0b39a6a82d877db8d799d239f137dc7e74bab5f414c6d9db8056b678a16fcbcc2b019d33a93db2df945da122befb1d8fc3dfe7a3cc24053c435c41c3d21f8f93c8da90b730f3db7a8c6b7a62fe8f7804cea4c5729ccf0752afe553497678fbd791b14c63cf97a90e80081aa4a67a88f89ca627f70743b203af1d87ff973e7a10d9efb7edbf31063e5568fef13f33ca1fd1ebc324d1b3cc439da71bf722ac610b8e69c65f6e1874f0065b03dae3ccfcb7728591036386a2b56f1093cdd97ec0b3ea6a2c3e9fd7079c54f177a34c05966a53e2fbd0d955cecc0b00e89aa6cffbf5eb865a58c9afb78f70ef118023f4964ca69914b8649337a373e1c6daa95be73c8d5ea8dcc33498a8719bde4c5222b250603f2760a6f382fd95b087774ec75b12cdfa191457afa616ed19309aca1e8a35668338bdb63c8883deec3b65fcd1958ce86535c591ec2ecbb8973c31ae87f3bab1fc32584e1d6482a10debb382c52081289a8f9f1685ef65c3eb7f910eaa5d1f0f53f884fb2911f6e272922629580bf75671f446df0e4e2783463d0be3c9a4c4b4f1d9d058cb66566c26f1ca6f210e639900d456dc315053414c583d6f52ec396ed1211180207c273e71cd25122a2a1e45b2899018469d7fe1cac82be93f8a7d77ce634f6abe9505e516de6db6f1f4c12740812a62dba902c9a8caa99662059e8db8631b13f8134f82578e4971f96eec09ca02074a3a307fbad8413f357e752c98db425540135fd1167d7eb77a6e0587cfa93022058e727184415b39c1a443ef918e72eef19cbebe88af0cbd2d26c3a838a14b75ce4511ce550e736627f7a286661539efedb68c680ab255d0857225eec4c5cbb7ce23400b0e03ac4d0f2a95353624145b4a376afa98b2b59a6b3786b706065c12aa3d46d92f5f07d4c0fa776d0b0fad36a2732a390283003790bcd35a357ee9e5eda21a0b9bf7f59d8e56a733a10811d8c5ce12de21aff96fa0d0d336fd29ab382c464357cf4218a95f5df8427c832e92a5518eafe08baef4358bf2c7f94f01c8dec3447a7b06ee68aabd99b05b6553cd80c61bc3abbbc587b2d3ce264c9ce98d176ffed6e9a26929ee42ca96e03d2354402293170e55997ab25f248cf8d9097a7083f64a184e002f18834866918c4366f72c37722b4a80fc665267c9dce476fe554560723b0694cae7f5cecde2a1c5936b3bbfe0eba6e8bd8a7e47929ed699fc705a56f87588264559c3ec92196bc3e1ff2e483e72b76ff858b9b40beeb6f5a14754304394671a3b0209877bbce86de9ca7b8668015eba04f038aa419a906d8dd22b6126cad1bd0f64c06c8245311520269bb789cdd1f4ead28806750deee4d9b3c6ce49947ebcdee7175d430c80f06fadefb571e4ef45bf2b6cbdeb4fdd30a2224799dcdfc257cf71766eba4388896a873a0de0e3525aef5762d8d1618d494b0559c11f8d320323bb6953bd48444eec15a6d6e014b31af963d3b1d4c9f9b58a820915c52f997a8884f48a5883d67e214adb40e6e8a6935f1e60c711264e4c5f5565386e079f7ead2fa545be3b0d541f22d71a221edc76c46651f412fd0f58857ca85528cc3490d9aab880e07e79187e204395d1e8d8e3790fb55c918a98f964f89d624b54a9bb42426b204bf29dfd86c4c1bb1a2518845c4115b616f1d90d91c07b4d856a73df98f4cf3e4bd4ecd404f0e30dbb60aa2cc301034682730dd63c899f568ea7f3a5a431c0797dc162ecccd25828917e4fd20c8ded55da66cacc9b95917dbd4c636be75485dbbce08da174df4c4865df026570f785e156e2d2d02b4e6079b0d5fae157df7c9f77e2cc08f78c5c6518a086e66d19d7e34f2cb21a1e8242f27fe9b5581f3268108c030f9525d0d690cda5fccdd80585e74800d102415ee1797b11c511ec1dfa923c5bb55ea9745235c12fea0a7afc8f08940b7313cbf63b8a3bfb5cc451cdbbf2d0762c92b51a69b1751c753e0cfbc34b7be2c21bd9097fababaccfa27908585acaaf9db1c6472cc6c33796198cb49887002b18b0ed272deedde6d6a9b9128ca7161d556e2bbf4e4a2c6c384ae61b89ea6aac71eac18465d470826274cb5f50fb9bb595753db5dd6c1151284cf157fd01c8a1c11f4a293d9ce59092e9eba0373b6566a0856000f9acffda75e616fd0c3c89e8e2d71713bb302bd17d8d26c624fe37d3d86c5e472b3ddf424fe3d8591d7783b6c4271bec4068b220effc665fe3afdf0a8826682a5775f90ac27f0ee6c4fd2230c8ecdb0acfb84b87d9a38b786fd184df5724989fb0ff82897cce941201be59a7bb0289b640531108dc6311bd8ecf222dff3334ee850b4a542bed722007609d625ca2f0b044055ea82f4fc55623820f0689aed94fc1d63545e71135a3798eb93cc6e0cfc084a2cabb528c7abc17e68dd7684463f375d9d18261cd97f6e30defef3f5ca673672adf52b87bf6dc13b289a4080a5295b6c532d05ab4074026c410a63d3e4a4516951f80bb8a7a2615ae20fd0980f6b7fb2572b9acffac8c3a8c4a35c9e9227955cf122aaca0c45ed590de81bede05a9f51b30a6e1871237d4bef1876f892672a196fbe3fec0c54ffcd4f0b325553e7d072f8db3086b2903c598238f44518c745c314134db187468a6a22f98570bc5b2879b00b49739295b35e7c54f7dc6fc2488f8a136b518dc32f1020ceb5ef36bb55d519fa112dac574e232720a4cf2f2fa37b72ee1968aad939098869983eabd3ec709a637d190e8c6f52760765b070d9943bcab836d507f6 +TAG = f508dd5fa3b3e1fb2951f08ff806ef99 +FAILS = WRONG_NONCE_LENGTH + +# 768 bytes plain text, 24 bytes key size, 52 bytes nonce size, 5 bytes AAD size +KEY = fe76eaaf74ddd45602b4656767d57ca2bd10ec9c236e1f84 +NONCE = 54e0b919c596670b632ebb3c1b51a62c400324d36dfe1b63b88ef255694bcd52d9a9ae061b5227963e7c461d3fe6cbf11685f0b3 +IN = 39bf24d3902aca822e54476de41739b5873e8cf1680243fed2d2de685559b0af4134155188610d40f5e3c5ab2292b5d071bf37859378ad3b5884976c255fee4b32105b11fe8df7f554a41adcc8d8979535f9ba90752c7dd5739555583812ed320827bd02e4b38e49c02eb4081673bd7626adef393d1d537fba1031390a20ca0d42ed8c702589ce8aca497ee46b9af36a2c034edbd63704f9dc565b0e4e065b4876aab1fd78d789d536ece60087f52b2a18573dc0a6477bb3d06b31d1b1dccc429f8d6affa9d38a4652b487a8b3cea038b3b66bec8fe7529762f410c0d1d1f50393552dcf557d14c89cf39d3d983ce3e5b9627aa5d51bd946bce6feaf378870c7cdc4504d5a8dfb67066308dc8bff7be0030f24c798039bad3c397c8dd9af6add4d1b907cfa2794cda51d810d2e082d6286556e2f54650c51a02623e8081dfd39d4a2d7a007174f4d89d3f62638e1a99da9fa004b2070f6a7c9db3c8eff00edc8503247a998991faf58fe1f5f8dd4f023db9f01ff37910df2bdc8fc59346d55f1cdc1b54d607b749e3ba58b3e888ea1477d582be5d09017d200d53dd301cfde1cef7854202f329e1c916ebdd280d89799d57d8d908ced271db3695404ff39c84a970253df99e0977bb74b94a99cf4f87d8e0296462ca03a25c2fae4d3146dc3e642fb3fb415934424f34c1ed1b9df8006f54190e42024a0cab9ab6952b758c4c5cbdefb083b72092cdd6a1bd82ca6c8788cc192d7986b9d34be4358b926d1f5930f71db3f0925e8a4aa957274c19006a9224cb3c4fd11c9e34b709cf252ade0637a12f122fa69e4a13ceed189ff38ee14f266c50718bf8c5c130da033ce947947611ad261b280e1f7117fdb9dd1833ac10cdcb38b032a13849fc9e821a31f61aac6413cb881ce38eb5cc75a2336b17303b1bfbd18e6f7f8f3b1653cc024b489903a8b108aa350e043cf297be98ef88f76403c9189d5b0edb806b28e508d8efaf81d5e439b2c1221b10b0be6876383b599dd9fe19080af98f55efb1d819fddd2f0e610cf90ff4ddb4a2f44dfebcf1ec32d15f515a1dcdd5ba82eb89fce2518e5b2 +AD = 5fc2c68918 +CT = 027775b8ef3ff036d1900f0a8a56666b50901f48f4823da271bf775bbc8c90337b60200cce2b2fcd949586bd8258b7fe94406bc84244d37b0e3a7811a83846047568e6bce910277924fdf989cf8d8a7f7c4af20130927e29198a8f974f842aa50c0a8d4ecbc383fc38d9c3e891f7cd46389a0cf627eb4031c2e9abb18e52549fb727656aeb6b56e220e1eb433f33b0fb1cdefbde1145b066852bdd7f0308f2c7f3a49bff754a2a3d01320127ee69fc6369168a6b66a9d388143a39d0f113c4cee77ecc982590a9b102f6db709dd65165d0e87b19ddb19fdd44761c420731fc27c658b57b4b480562382812354fba3cfb48940146217442668323dcabb066d3e8b5f06ccd4726065b86b03659418aed56d05ef546780f8f78a582982b61ce346a818f17694aa3931fd68136fca11a3f7a3bdedefb22f1f3467c8509c15c2a4f222bdec1c5cb8d8f39943b9ed08d7c6a31ebef5c1b54c317729a4f6786fe6a91b2e0ba04eb828cc4f5edf3b7e36149aa61c3651214eccfba009714e945944b7e63d54d70c2c8a3f97aaaee829792ced05b51a04d6a16d4eb7fa8513e6e3976ec7b89bb24566494b48497b31cf9adb8fdf3fa028baa23ea6ff038e861d07312686043871684309fe20511fbb6f38188be63456bea9727b1bfd6e9b9acb5043244e7a70615e91865d3829b5c075cab363d1051ebb12708b9b5717955b5f91931b1a28422ecccfa22796ac2d9a64a2eeee26b53fba52535662179cb1a90b3fb86e415dc7c7fa38e0669020c0dfb357578602ed957b2621d90e1ad589db96cdbe6a65fd841c7063f5ca955e9a93a5edbbe7f961ebb056cb1b941a0fb1478934e8f9aee4bbe67bb1c489bb04a0685254dde6304743255a4e5daec74584465ae4b06d2cc1b38ae0d1a828dca59d633335649afe6539091b45559d8984efc2606a896fa008e56da15b090d67b1fb6454728cca450fb95ffa5884a115a3fcf60e84f3e2fc84c1e235c7f432fa03252adef6cabceecde50fa54f34457a90a5bc8d1811e4bbb55cba7fca36e33ebd7005b9b6724bcbab2bfef35696e8e0086f2a49ed9d57b54 +TAG = e14c77773a7be9c37fbf6ce1e3e7bf88 +FAILS = WRONG_NONCE_LENGTH + +# 1024 bytes plain text, 24 bytes key size, 55 bytes nonce size, 12 bytes AAD size +KEY = e9d893164a3f213961056b1f78a08bb7514eb7484092ff38 +NONCE = c071a55dabcecf219e5f715fbc807d37f59a383f99a238dc4ff4763a68fbd584ef9e9ea67c816d02f92dc3ff79943ae5016797d5bb50a5 +IN = da77bf2699d286faf4d6d3f8c87e7bc96e41bd81617762cbf09f7d612c55dfb6214f3d7710ec1782ecd888e951ac621dbf8b302fbda67999edad66f2b7df0a54530e0710cc39baa85d8ca4ab82c6dfb3fb50631b1d15667154c1838c18d2115622f2b7d8c34922784a435b39c3752109f1873d082cc1c61889dd956e9ba442f92a5726422910973b5398fea22586be4bca1175877a6bd44b5db8e6324504257b41156fe599a41bbede8751e5fdc67379752fd7a82a414fbf5002f9373ccd64bf293c2d649a3e9180d655102bd1bef8200e1ba59a42572329c6b7f8696adddf8cee0a99af7af41d123a684d2f4628dc3cfc433fe9003d3978093e697b2cb2f799f8f0c6e53e19ff0d56835b14c645b1c3d6de226773695a6471e1391e394b4ff5b11d6126f3c6af09cc73537f3ad570300b6b754c5c38839001543ac03e4f52eb47cd71b51aa19f7a90698d4780d7cb4ae8911d4d3870a3f4949690591aa1a5c015af7c7c809b5a243efaa99a15beaa141d969941ff9a07e284d18a69b1ec38111785f7792d81d6196aa23d506f12a5ba3ab259fc550a9e1912028665239be23979f8baeccaa557ba9ee07bd9de5fd92fc9878125ca42eeb85c5fa751f7638726d5de3f45c5c0288c784c07bfa1836cfcfb24bda68fd25270a6dadd8666e5bcd64f842ad1c027b65db9fc5fb180cd36d950c699345642d3c4a50f1eff82544958f6414f1cdb4903f80e24d0e3c2b910c3423a1bed9c5de1675f9d3f5e49f70fae93a299da5f249b6e85a4d4359624854ed45d6686bc0f445a8d5c33ac3fdf3853de49cf5d1d70c831f24a3b42d010d6d3d4ebbda3d86bcbb987100666d13e020d3c3199a640ab75871b3d06f3560407b85546b93c861fc6402c671949d0a6a3558ee1fb56698c2a8d00a96828a9429ad8125dc96742a49ecf925078c4fec4f4fffacff154a397a12f34ebc3d4b8e10f43783b207043a865092d863699f41c4bf19d74452b285831ea5c8a27f624a0c06d70b54835d5261aabb5acdfaec30898b10169c030231e483490ac08662603b3f549c3db7385edaba9dfd24e12b66fda5e9419699e77b04dd851122f13ad0a2b0fa25490a0d5d7b4fa9177b796b4fd7b3b353a3fe35afee46be399daa380a01c13ed318b4e4cdf3dfe66962f0aa24c251466d3cf4354e1588b7add59031f14ac9ae8788fca270e990060c4945c0bdb24e840b6f43fc37f55fe7f5343566ebfaec9a0d4185b4d99c1548d2f5c9626698b7a5cdf8bca14764ae6107229517eca02a772b608676cf60de75da7934af9bb9bd60f8b75909aac7ffd2e05e7b38226354f52d343094200a1fe2de7f4d9d727fc57be554550935949ae0dfdbdd3c02da43b93c0c8d38f99c25fbdc23cd10b086194eebe7ab995e60e17ee4ca7b9fbc38b219c5db6e73d51dbab2a77a1b3dede792d +AD = 1b9992fe1cc26c57fe3ca88b +CT = 65b3311628492a43c974ef7677b4077928c051bff879a99afe81d4b2d063888512e97122ad849d771749426dc7aabb6f4550682399bebec6dc3c8858bcd38d358b4bbdcd7723692674612a9515a42597155bd89bf0ade48a38fe3ad8842ffcccdf664aeb6b8809754a629a1ddfc6927312272003f8ed0e5010372dc5f69937b6b560b92c37a8695b430b4537c537587a633ee1059b01305d2f87e9718e35b14f4f8b85b9d92e3c12ee3cced370445741e4684c03c4df701789364c08f8823a48d6c6b33ede2fa79777ff1ee87dc99e472c6af6117c485d03ecf65272729fa1b0e1b7a1b07f686ad982db668938a7814ecaf1fe31b16ba4d7a206366a9cfebbc34bfae976ab62a45c7a432073ca325b7505dfcc5a926ba8c4a156054022a9f257e2e03642a8438ee8714c3eb29f59fc6cde170f40929c210c8f9343b2ef0ee31757366e90467e381f299d5fa918f884930c505ffe9938c4d860ea32e57ce7b6492f14eb53c63ad71124a1cfe456683d327597f5d066ab8c385d6d8d1b61ebdb27b8ed79783118e8c04cc627fe7bf2b6962f724c54ac704913990bf080ec2341cbeaf0cf21690c074e22500cea46b99a7651e96e5dd790c18f6aee11708b3bb39a6ae9bef7299e80af56c260b551495d08846462f52c46b69492bea6b1607b0f134da5d048a4c183d8b5781adabbef057bf70a759e11ca160698a9db91b7a737530e7140d4d622142f055880f5f5ff1357a099b4b7acf531385777cfd20b14d9fc70af9b91d40b9398753c53f13cce852dfc1b1e6a8d16d9630684444c4b5b8e51e7d9daf99bef6bd5d97f3e8b7bd4ea8da3505826a302240a2d833026c523a37167a7c8510063c462c3e652c79ad6a60b07366e2f2fcef4598c3d04a02d71c84d693f1672d05b15cc725b1331a40de942a5809abb9f219deec00d0bb358541649eb9d31b96d8626eb189415e199cbff692b34dc1115a6534684d625d98df20557b9038483e2b7c59162d7076e9f9a4115ad29c09512122a766ee24d5c3a36e7f95acf986daf184bacf3d0a814d90e5efc13cf5f87dd539f978625e9ea3dd352ffb429aea04c5824a3b4e7625ee1c13bc97f064df57e9e6404f48a6d33238f6e17d1c179e9c8829658cc9d299614f099c405ee186a98a528d5e76261a1bfaec3c4227fe6835f4b26be572aa042590e96cee7ecd237ca416ac60ac186a8b7d30e694e2c910494a98c4cfd42d830ebf4b43f76324ad7a5fda069ac62bfce7a64deba8c2e2bc1d03a28a717f2f4e55e908d79eca582b796e75aca308e5a8a2a2e9e23a19406a61e12b31b04d6efd5082ba7a96e08250f7a99748f6234fde252d73adb126a2e06e882083311328ebedc00405553b7b0ce6dc41b5d34360e23baf9d6bd48030785afedaa020d2809b91202fad4f08925edd1a96eee9a771940ae04d2f5 +TAG = 2d410eb22b36975b445e57eb839420a4 +FAILS = WRONG_NONCE_LENGTH + +# 1280 bytes plain text, 24 bytes key size, 13 bytes nonce size, 1 bytes AAD size +KEY = 0f9236803a4ec0f4a05b91c417202e30b09a9fc181b539d5 +NONCE = aad7b0fe99f6c9cac37ce51a77 +IN = eb0bcf9329fbb40338515f0d008f7bc8ba4dac42a32a7fb017466fd8c11899d763e581af6b506e8907cee4ef5e601a100d943e625623a35991c6ad55fdca2db5bbcc0a602eeb08f37b1cdc49c887b54675da71442fa5c7d4ca5e453dbf41b0deb41f9cb39f555011894f9504031e5137a32231885603e1e17b745a7b74be9442491c917fc816540788f5bde2e32ff936161e9016fa342bc3c2e7456a656b2de244f299825143d10e720a92c301beff47e897172353149af9f7be9926771345a1c7d135e6f362bd66d33dadb088fc1d53a241d855f909a1407e61ac8bf26c0f177e39b41aa7745e98e5f803b02066bb6028a2c06f72994645a494593123a2036c666a2fadc8782bce67afd4c28261fe2d496ed5ba3b9fe79078a9fbb01e1e6565cbcbed4c72146a4981334e8c9b84244df9af41afb27299bf021d04660926aed67e4d0fa8875c7a929342bfd5973b69007ee1a270a671d734707acce4530d4915136e16fd87080a9bd0d840c1f316bcc63a0075e0c7ea85ce1c368685db6cb5d50b42858d80bffac8f4a4fcb5c654fb2c3f38b91550974a1cb83d713e2bd81772072195b12a03ea366b4259060f7f733aacff1354deabcb2f720edb58379439f4d2964dead0bb842a3e5ae568ab3b83d8824da97a88b0dbb35a25e79174dddf0218e3fa0d2790d2320cec34f775cba1830ffd2e8401e5ff4aa684f7cabed9717db4d8a52cec44fef077efc7a68347463c8fdac6101365d6d0564b6b5ac298b79b1506ff646055b59f627d9459927cb0ef653e19aac961e8a981fc93b002a9ea6de0d64fe4a7d8f973e5d1f39afd965073cb743da6c8f8d0ff5da348897444cb2e32c61a54e39b13cc02d80bd669d90625873c4636fb5fd6bb4585f33eafaaba7f641d43900196279b63923f5dab77c9c9928a66ab846ea4d879e7d09a3166d505a7c6715808c34f8c89469b9bdaacb5aac75f107467a3021210cca85da5d0b64bf3679391d0776cf78fb46d2b3a9e226a412316c69bf2d905aac426f9115c4bd496bcbec31a12e0ce303ef8873c802a4bf03143d3dcd48361fc3c419174645e55b22a1a7f7b23f02854b8e778ec2d40bb719ef29c3030d5864efa897aeaaea3858ac19c40420db3f30f89aa2c5b9135a12b9b29bc760dfc4a67b65f72a51ce5cc312624e1e4f416a0b46fda0c65e9461360a180074f268b0d1c1cc3ed98ccc467be10d0822fec6cb40b4872d9f1d998d9205124d909e753cd8e3ae7b0b6a1e2d5e9e4a9952047e6cfe173aea0e2c20e3e0174debd4953f5de92bc978748984c503692075ef7457b49822ea87cede0ebb9db83a6a8472cd2c66949837ad3b08192227367666705f9b89dfdd1ae35a646e59dc35f050da35d0c5c9c9cb8d4fc4f5551111aa1c99ca04eaff1251d75775db64baeb25713e2999e206e18f6c1eb8713bd6a415f6b5473a52dfbd86343bc2715a8ab71ef428db85a4c79e950dcf28c4ffa127295deb338ae3e682c3498cd7a4e3633fdb6f24c61c57ea627067996f4752600e1c6a1f68def07d8ced577c6062593eabef905f6b424dc2cfc6a30e6fe23b9569898b16465254d28e47c3e16f73b2d2d625f0cf6adf6c5336bade375e790a4744a11dfd872a60131382ba44d657cacaa2ec87f9b3ce673aba6692d724ec92d49d735e9e43bc57ee6772c92707c7abebdf48d74c6f03f8907c43cffe98db3dd32cf2bf68f0225811af9e4ab81770875036d7b92628881cf10665ca5604650438e2376c66f7a540c6f97b06b0e52a4e1948263d22afbf67024b3bf0ea256f8 +AD = 18 +CT = 82c26b57243b3c938175018add74e1c6136232489cb3a20f7a65ea6d225c28cb6cbbbad27f26da62f29403bddbac0517b02527ba1bba215c8ffbe2ec60d300a260e12806f493fdb6705a99ed2d479cdcf34895ed5ad0ce8c7ff46e0da0a4727fb0ba9bc71995ead6729a45fcb5aa457b676ac296051b230e592a35bd30b32b8cd3c856e91c9c319d3f93dfabacbc13599f5490e840e235ade57a0f5d1aae894bb028db75f6a9d2eb5f440e9ece47c7eb6f4c80bb1c14bef924cc9713835aaf856f2d069b9600927ccb6eddaae70d060fd6e6feee0d6a27e9a4521e0c7b3e981380d2e03324fce877561ff82e901020914abc5e6f62c8bee95d4be9eae235d18ae027322ded3386cc6b3008bead9c483965f2f2d843b6f2d7f3834270d9a001d4145f6253481e440dff8968a0718a4e1b422827df164090b372683d734ebe10c6a07d5f6e9a50240b5c652da71ca2cc9ae04d9ba5c6181386536cd47498548b5504394418a1994fcc31ebb39f91f3052f210da9176e0f328b6f225fb78028d2d31207488ed0a9c47664d0f4286484f34f159ba56924659a153ba282ddf63fb7910bcf8d74723e6899980432a557ed5507a177b7b9ab8568a1b960d2cd7a98e55246754bba21572ed685a1c645739b74e3b5a58114748a19c042a51495a26cc173f51dd864e6626479d8cbd042aad9988402f38144c940b6e4761a892284199a992d2eff600f0059243edcf2af81054cce5b14d3c67089eea62d0c9efbd0a51e896e629c06f2486fd607cf78612dbbc7fbfd0716880764ed1955ff98f6ce2cab447e7ace2bf4e4101138c18621fdedc996a0a5a3d71f8de6f33388c8e72f5119aefd439eb37b0ef4e69046b9212b26b57b4848e9e5198d3ddfbe0e314d80470171f067861e8d91ea5527104dbf3fa7a26d6103c887b95449722ad3302a44e352515fe6b9ef4d5c790962c483bbad2bd5548189494a4fb96cf8ecd66eb9321be2bba2fdf0afc3359bb07b623c74c7b767cd4464e722e000112f2e42d84cf218bd7010becb1a952d05ad7cfbc39f16083854e16be107839833b32156633d82502882b8c43cb5d27a8d7b3f1d7ecf4106f7b1540b9160b3c004849f269eb79acdbce933e8c56ffbc4853801549ebc539268b10276db465176aebcab9bc8deed1117a16d0afcb0b8f062e641139e3b73334f3abbed42464b3e3911c20b6b65e133724665974ebce55e01e7b1d7d877cc7229d9c1d19d3b5ca42eb86b333329277d288418ee82a3c78d3b43b4c7091cb2e88c861adba144fafce6a861f9a8e741dc334f7e89f62c396433e9f71452dda10634eb3403f127d001de8fad04a8767b43ed3ae7778f4f1ef58f6867531c824e408dc971eb32c15e467678263706e31391c082b84314a8b7997e989134825a058db1bf6bbb50366aa8a6f893bb5d4c2852e31c8179c56959e114089508648b6ed0ddf20956500d9bfcc8a9b91d81e55141c51cef1173239b4b969edf65355d3aa019222c5e9c1d64ce1573b8e847ea0e6b134d4dd7cc6d7e979abf06f412ca24ae57ec01cc93dd005e8f53204a8066457fdfde090b58ece584cffcc2cb6a24b38491abff318ff0bb274851213288c4283aa1656bd59ac455f4ce624b2b57adcc3237bfc4c0e218d97224e57d9ef51ee2255996c05cd476e064f78f6a1b659a489807c15f908f2d2273b893c7390af8c1a552c00f08f47e92c38cff54509e9edecaece2a998e6c015d8b5be8f7fd282b6c1c23f3811aa4a087a9b21004dcd24ef5eca4bcbb1c96cf16bfe9169c320bf6e7bc9e5 +TAG = 9f1e77ec482efa553fd3b71659016f85 +FAILS = WRONG_NONCE_LENGTH + +# 1536 bytes plain text, 24 bytes key size, 19 bytes nonce size, 8 bytes AAD size +KEY = e4013837144558b6f4c3d0b577c9f517c7b36f1770079919 +NONCE = afb27542fb08c1ac97344aa8db08a726ec4b5d +IN = 0a4a507b3945a4754276bb97f0609533e1044ace5c134caabde48e6ff46cdf4dfc4b2ea15d97b8e8b05da7938edacda31e20736b92c9b33583ebab38e3f94a7dcfdadc7a1ad26dfaa22a971ce9016de32d658744e315aba457506083e21b2f6272c4da8488389be7666bf50c84fdf8b689ddb6920f76a24ec596d74bb6a0cbc94bfaded67a3b331e14d7f1100a1eee8d4301926dd901afdc7b153f8900e8adccf8081a114594dca160acedfda52b9fadffd8e9879d94f5eb5fddc9b33b6189f4b1aba7c1ce233fbcd7187cc4d53253dd3dba8e80eeaf9c57e5ecd7a8d8009592899d722188334432722cb2ecaf1f6a130fd73d2dceffa535de8b369657da92971222bed22d4d69ab2a1bcbe0ffde399c830a67929f3f9ec8ca47ce41647e1c92715d665b0151ca570a0b87c0e0bdc2c0465ca24084dadfd29d8a565f465532734839ac04567727d539368807ff4bba3328735d3ae5347443651bbf9752bbacaf46c2721216dfdedeef77452411b8faff530946f87f1674deae1f4d62f4377160c8157d59ab46b7a65b52acc86e527ccda802a724a15ee1125a7e2a39a9c3d59abf411b6e86f20fcb8f48c397abb2034af00db479dca0b7f8efe1aa5b91236525eb456cd020dfc331d1b9d21ec153d3872d04e0741b023834bb4ec40ef19698fe18430e66045fc209fc1c99005d73fba3e600f30aa2b59c0843b80b131b311c35f345e2117a72fc7136cc61aaee65dae752b4b6b56678dc71b29cf32f796afb07ecbfde4cfa30a30bde8c6ca1d26694e427f992a1a3e795604344b273015bbe64146428282ec56bfd0b0340ed65dc282cae72158f5325ce3f15797d5ff0b38e320917622740d4e6c27dac9dc90a80cdc2bfce88ec39ccd2a08cb7ce348c935cb938a2305e5e1d3c78078f2eaf6256075018223b9a8df42ddf1edffa3c06e91901e60095cae3e7215fd613d987dd1e485ed02a74a0a2f120a67e14224453716932662407e508ab10d5362f8910c865aabd5d23a43c4c81c204204a5dc0a75bc60c5c41a3467d9bced0906674b9847f0c3906796adcd75023219935c459f41f40c38a89a30105c4cbdcb4c2803d045ae5ebf8093512ec83d0158e848517b0a23457aa55e6cc69b8a91c35631d6571eaa4f61e44304bdeaddd977e5752cebb6eadbe99f8e254096dcee604a6230086ee8089396b336c55d8130eb4c0de7de82f8470af4e0abf2a8f4d8bd75a370740603d2cea8a1f79556f74e47a24a73e63b64dbd89a6e7d98c257ee7e0802ef1184dd3080b8b2823af1f8d32f8e37aa370e80832cb7bd4f8e27ac3f29839a9d2f332a2faeeca3153057ba45c3a4053afe4ed4daf7a2967b911bf1aec5a5a67eed18178445671475dbca22521e7b14654912ad15c0b85b928ebb623104d2520f7b5fa2008ada03f097b1d2020625040c9b574ea338644be11fb2e1eddc8e843d83ece7392ef55fa8b690f2645076303315ebe6c9e0bc714f83889cdb0ba88b9f61328fd4b49fbafb34f774b7fd476fb36430edbdb0de5d5aeb50d92b211b87c98d9a8475744ba40a07c479dda4e8817597dece50fe189fb7f00232d3f645571bf213fa08524fd935306b59cea747d77e6e8aef4746cec48c3a7edf5d772eb56d20d54d2f4fbcacbcfc3f4f97d4b98eb6bc927f020af5ca96382a3587d087ad54421f9d58a47d128636f4d19b364f09642d2e2a3115e7450df3e5d70f784ab69a54ffb896085ac8e1231d5c72188248a15f02ceaa9fd34f02cefb6488e04f67e80f8d8a391dac715b1f568451504f981bd39596dd3b783f187f2949fe7727d156295fb4d2471953d6acec9d2ef0811204bb21699142ef115a68b1eae7f0b6362f3c80b3a49d9412756950912400df7697525b290c99be0de217b7dc585f176f9778a4d81f1299d2bf1835911b9c31dc6348c0cd9c6667ce002b82d5e258df3b08b63ed3b669c9ac112188dfd51474cc37ad4439d65808f50a17ac2d8383698971c13a48084362c4970bec4e60e689d72242d3bda6ca20f994c1b92ad252dfa2071126d70bb0dd08c8998830ea20c343bed54f7898a2b1be98dfeb47fd8fb09c21acdd3b8833404429cca86cdcc6a7b18184d32def3ad611a4a7340442196f794ffaf196395bd53c4c85474a22dd485df4505c6de42 +AD = fe3276b8223bf8c4 +CT = 715a20b721edcf23de8db1b465d76c57eb8998a463e2c4ecb1e4b1bc49d65edcfb80ac64a4541a568a70c7664fd94682539e29e5d04f56ee732ea62713116eb22b0281fedd43bc4e2ba9c767c11b0785fb4f131c23e012fdcd50dead5b21638127ebf29928b507a120f6e585e3461eb7f04406adfb7bb283ded0218b03777549564f2cffbc001c6ce4ad24891d364ef572756bfa287e6d46f8444532b780830a2e232a17e254eb7980497f28e6f83e85006ad76603e07c4650ad476f1a12045ad89333c567a6c45ded647fe5100ec3b0180a397d69c497e278302ae2307cfd0fdebbec56524477892ffd45be4bf04ec3e1891a9a120c6e20acdc671c8a720dfdef4a3003b1bfee890b5c1391927eee072c2cb917a2d2c8cad2768d0862e774bbe38ba159afd29d9e9c0c0e3b031d37d0b8f052b57d5ed17c3ddfb5cfcc3611cb6075b3f980e7ef5a575febb4ae68df6d62e553ec99db4cddef9dcdf7c2f478bd2827d17a74bfa3c8d9e83c285e768096c938b9de2bd3375d697b60f7a5e3881847fa389e4d5d29ac698dab2b502255a746fcc1feae7662ecc018739c3881d13d785500081dbdf69925aa53f0f9aa9ab6320d69482c88174f74530326f3fffa090c6bf3ffd6e7935dfaf83b95d8e39a3d6272ee4cbc800028a64837a6a928d6df00730ac3d2c896dda9f5075ff2c21ae6af52ee3839ca0b4a246b1be7d398327cbf75d585e07cc9c02fb5ca7adc068845bc106ce60ab2181df27fc1cdb6a3873b21533c500fa62907cbb3a8bef7a586732b2614fc3c207df4425072f3e438558297d7e1b002e10450faf5df818d35433828648eafcee4b0610ee7508cf3e90c2e5461f22f9450a0f22975dcaa5439a4f3e85bb26a133d0b9ded5b32630498db48ff57bfe14c60b714ba04a033d80938afba274e8511506d87630a956d945174322db9ef894c17c72a92f94d23346f08657536f53063dc50c56a7117a9fa46a105d2f89bdbdc726a2c46ddb615c782f892ce4c1d97dc34daca7cb69a0e35a380e0180802c01c2790d3631ecd7ec593212d669f8783a2cce3dbdf071e2977ffddf2eb0288b6839353934a6ba615c7956e0dd79795be1eb31bf1d04ce73d81134ee677fb351324d1a958733f1fbd39828d16d14240baa329042bce5319354b0a3c9de578835e8fff7544cd0c4362bbc7338b5f4d6a1e507d6e86c00817743164ae231c90496daf8b037deede1c6541436bc103f480036696b0fa4ab3d871490bcea308c46df3beea27f05d7771f5faac526533453e02a470408ce9e400668c7e2116d5b01bb12c03f0b16ff8063e87479e3bc8f8d5e9d8e05faf8c51f53152cd47534de45d67778037d39c2a95f0f027f34caa680e7c9f1d3d3d9564a2dfd455dba8df39980bea7829a5cceffe804791f6082c75c6de794cbb9dc3bf13836fa1251a8f4a8de8d72e8c66179ffbc78e32fa95a54719ac69b5e0c2cb7956013934c279e082c897dfa8c882aff004caaabf35338173c16bc07bfb2c39ed0790f2aafe7798764436381d596f41b56574e768bc58816e02c423030fa6327adfd1151671153eaed27f2e8ef2288a85512fb1c0b1b0ae8fb8ae323960f31c1c842584a4c1127625b87acdcde91b2200430d6142fa946fb6b3526ba84c21affb9c90fc632f95c53b6f95dce36718cbe02df839d6bb56d6a4080866a50fe3f6f3dc05fa5459bd7f276a2402d708fcba16afe2f049ce73dafe29d555244098d5aab4b65f6f68e62f5b501f335eebbd72132f4fbba3d74bb9943a47d17a8f2eb85ca3592d6c0ee0623f72c0e62befe18511643f9daa637bc25bb9989458c70def95def6e84f73da730b7631bdbbfb61d0ad6077a6ab8e603d19a1feb745c1c10318a918463a189e570227b1520396d89c8d53d96482adf36d235b069650c1a6cb37edfa08d0881b6c4d4211cfe9cfaee81e1c10bbd047964caa7b05eaf682679a8e40c9d53852e7d4ee6c2439c6f48151d4c9342e99c77df19bc90069dad31defcfbecb257db7acb787892909cb6d3106b6d2a94376220a2069449f02c708cf8d70456f9653d322292182571e9ecb36675713ce806add2c9eb273a47f790f75d3104ad79f9bcdc8afb175d4e07fd50358136520f0a63816e00fd22a7fbcff384d8843d686bcb5ec +TAG = 5b66691a5e612bcddd724c1e1072004c +FAILS = WRONG_NONCE_LENGTH + +# 1792 bytes plain text, 24 bytes key size, 40 bytes nonce size, 23 bytes AAD size +KEY = b34a9b822681c873cf2d992da5018fe2a789afd5cdfc0526 +NONCE = 446a34c115d53d1e1bf4ec27eb184785428ec930af073e4bce0f654f0b3b20a2482489f45edd9036 +IN = ccf321bf95a3ad2d2200d3926aeef052df4104ce358f4e55f1fa1ed31777b8cfed000121141f8b054c90e5e9ba4ec69b42c721016d3dbbeb037881b912378ce890c24607c1cf66bc37b8f236694e4e0b3b49da4d7933e7408b720b66e8472bb40dcb66c335f99b3820a23fa6b724b18a5f625d5efc9e86b29c71816a1fb0e532de40917f178fd5b5d8afbf4cec3633f4f80df3a1a8dcc7b89f63bb71827d6297e04de848d52d24366b7b1994a4771110ed53e82c96bdad7aa7b8e6f5188c79ebc3d324f8e8eb6649e7cbed4fc1d354374e76b7fd0c838b30ea27855f6c2cdd3f4ac94a6c00c6cdeb93c7b0a0055904b3094868cf18e2adf263934202f734fb0e27d0f382e7a6cf88687829bf58aa85ecca58773f6e24569ff1f85cf54a7df04f47677ff9f0b0009a5b8368db378a71433675ba993e5033d7aae8ff968a2f0bedfb4a911973a71e89ad0cbaee696e5ae165d45c967aeb70e7fa0d3b77306ffffe692239b9e852c5c7aff752eec120e10f692ba1ce4e72f62a1d14c2e3521bcfb5a9a7ae9e76060d083976bdda7dc29fea7a8c94c3b521d6f113e3a60a9e3e11a3837a98e914471713a6eed2085e300214e8b89515b87e0b1c12a95310dd0e157e15b037325a86ca371654e7f7806b1fc2ded6110a7722863616b494c403ee66fc018f756af3ec5ee10c440295802df5818b0ca2c9830a4028074593153be6729fa348a4ce4eef09777c94d2b93f21dbd1b26c07e8fe0c108db28a4461b237207dc76728251cd73e59a30c53404a7d29ec8696b6100e4e09601a2f9452b77d6cd121e6b805eb0802330929f9a1e5a5dd4d01116cf265149401919076e62d2e7a581039bc3e37c2c7d8f2be1673a5b86e20cd107e68eb80b5814d40bb8089e0edff0cd39ca5d023b1a9b8059c03aa2d77ec0f8277cbdd669fcf3e937a9057209828e0bdd86532294107a4a1ed2ae84e01719b6547cf62c424b890ee7e6492f602bc4492010723549187329ac8a713520c56a54a3a42608e1cae2bd903cabe5dc8cbcb701608544fbf79f1354cd97bd7eac10c119baf390f2d300787e1bf2e31754457fbfaf8d8b2dcf24cfccc9add24645a652235f8295fcf0cd8ef917030c19e1dcd0375e9fb9c299ea60d512a20c91dff8d8780e9ab8748399c3ce8a54d64105b639322878eab5b24994371f4133a5acd7e78b5814d12a796bb60df1d80e173c39e3008ddebf95b1aea79eab20a36854c673d368f6efb0d984c19510c28be47c661eca3c7db11c55500e1f0e9114a587099497e99ed8fca2453a098919fb24526ba8e719e3b05764383b39f048171872c873aa72ceadc94d71882d6bf0bf7bb89c7cc57a32cd78845269e370aae42d6ff5ab03c636f76567351e9dbe531f7f4d95960749255553e43e138c2e06e211b3a8e29f4533cdc43af205df8a26408e81bc2876a93a6e5be6742317278b2b7da08f97c250c35eb9de1515386d8b6bbb08b225951d912dce64e0fb28baad8b2bffadfbb11c7e4e52cb3e52a5384b2056fb86b39f2799dba694d127da19a0aeca5e8668c8f91f250544349bf38d81b47090ae471b571bd0671048fd3fb9a7597c66880dd1b8553947db59482477fc7abc9b47c2584370f52517e17993baa537d15b28409095c720123a7188239df27a4cda40e60abb9fd313faebb4ef70f5941f0e183131faea7653adcea8e792f9f56a4bd7cdb8db213e18166757f7beb3b2a4d60ea42907cce5c5216071284085eeee54cc00e859317eb7daa90d767c0f01a2140add54ce7812ca3bfa9d3512055b0d11dfda405a2c6d05b3e1edf0edb7d720973ff05a3d427ed099791192672c646272937738eb7b7d8f245f214c74273ffa9e49a86009a89e0fa30f2fca9047fc8260e2bcbda164ef2905695c0a585c31b7bdc1cdcd1af47193b7f69d8cd12a294406c603e183528bf4ed154731217700c9651d613e94b35c49a082a95eb13ed3da5fd5c9b9068c417b33e6ad85d05efa16776842255700b05cb99825d0866a57aa72043f46a2748f89ae91d59c1b32fc60141e20762d794a5ddcddff321e0a6ab92a9aa28b10c942c8487ca466575c18c38408d03b8aab91752e246be41249987f8feb243feb49e6e24af4fc5cdad7a54cd0a4dedafccedf173832204317859f37ee83a0589360a508384da9f66696fbdd6fb41c52c7c073ab651579401721608b4e0975741a51360ae240e67bad1c2cb77cd4484a0852c953a9e59b47bb8ea86063b202736d8b7a68ade8b6425191689ca9dfbf23db8fffc4267df15ab069a9e7f40c7e82272a81cfe8746db95754589d0ab732e0cc224532e8739693c5fa28023aca598d43c64f64eb7c12203d718506c77c9011da329e8d83f2c8f8b759cfbc12f48c45da9cbb48c88d3145819e76d518760e94277ea40899c1be038ad783253b6e31681bc2d72dd195c3886220c8ba10112f377698d10ee075f23e5cc9709707419f51df0bedff049859330fb38f5a5889b07c6a147ee02d484f55b6aaa4e30f3 +AD = 28a96347a7f51c19ce0de026204569b0c99cf7452fdee8 +CT = 90d010b024c4649bd409b7743e8ed63b915b465cec2213e3cccc4e626f146867f564be01e4dde586bae16e4d9559c69ba43288a00efa680e14c5ec416736e643062a04e1e0cc94273c4b66d79208d5f4ef4fff694444a33d39682ce465c12677499e510499da310663816ff8aae88a52e9a43c42f246048719f45407f172abaa486142097882fc9722aaef573bd166b8003964698c56c6d1e3821802153c507751d3259ecc5e7d9a0cab94ac73205ce33de66ebd9a648149bd28941ca2659fdcd5e9bdfd6f34433bb7b6599c0f3c0a339f2502d48c5f96fe8a85911c615df109eae5e373819cd21cf8e61d6096e72eaacdb865e0f852e47aac7c09f417fa52bc96cbecfcd3df6f40ff525116640c91382cbc6e62c2ccf6409c2b08da524339924d9c70ef964f0a428bc6a601c2f84085ab285512c305c13789a7b9d7986d9472b88740df6057f05b90844d2f0d2a07d1f4b226de122035569b4075963b40c32e37cd3a38affcaff06dbb4a74f808137322b855d73276765255f08d7a94b1060f28c1c9e9dcd55fb171a339063a88b7fb98e8d31873cf254b526afe90846ccbdefd59b90d0ed358ab82a33c3aa471a1e9ffd3fbe4ee425eb784408156613e7b7878357c56c65cdf737272925318fb61d1057c6d1ae5c1fb98faabd8b40b2f0fbe8f2c9dcac00ce7a967605aa2b29a65571fe218cfb42f054a1d8d9f5fd4d98cdafe3b2c04665ddc0675b3dd830ee27eab3d52142bce4162c1f5fc394f1f0846c6a820c7a079e395744701af150abb407c1fdb1f453e244342c1ab992f718a0e5b714d585ab5da1274f020dfe13f73a345e4e5c83584010c7d7451545b56254f9a9e1966601bae82189f18f58f65bb284a9e3c5dd9746a742e8ebb6263fca45ee9fbb3816c0b9842b177abe1876a0ebd3e1ff152ac9a2e0b498f5e749f30f177711fa06e014b0e639b1d0cbf486c669bd2f219b8ebceb764c73c74caf3f332d1c48def71ab189aa330447ca6c27e19edfab087fb80fe7d7f77b76fc2108b884c4b3d030d32bf93ce2029f5f8393e8acca7541df26017168f2beb19985d2ea3ac249b43b50d40d2e9108a53c0a8cb800a74bfff373fd119476656bf64bc12c7d283ff903993926d6daa7016f892a73729dd84580e7011f02835e2881412a827863c826f81c0f0a8e4d241239b8f641d09fe39b733e7fbe1448135783a33f5b5c488ee9501d2123f187c6b5374040477517454aee9a00999982d24691f85a9d0e07fd10149e54562f7a76cbc23ea03c35212359892d79ab984c623ab87b45cf843642083c7aa7af56635a47e0ffb730dcc9333fb9e05ac2e4f57b2c0af9055fc5db070968e8f31679fdee9759f37cb9eb2ed09571587c388ce82464340befcf49372766a28e8228519d7349527faae83ef6c9449e214c36660c26d724c149bc7975f184df4b23dea462d082c2b0b5408c77acb79dbbbb253f19c991220178e614a151a372e6c5e3bb8a44d281c1a491592e586393ae1235eb7155cc5693d1b61821345ff76415a966d387899fdf0183ef83c7b38f4fd9f7c097259dd99888b71a91dfa5e08a7ac461d67057bc0233b66423e574cc022e5866e9f2a45cab7a4eb0c78f73d1091c2d6d0e9bad2d5d72276ab19a85faea5ed8e197b03a00d44ac852868f5d4bde96f3743fc1ea305bf388460514b05b0337ab0dde9970b266dc96b0e090a8ad47b895b0ffc7c341b171c4718ef058d20ef4b20d6fb6833f6cd06835d48c57639149ad8e0efac2c6b160a9dae17cb4baa4a0b4d27933822206c80814cb8dbccb6b1568852fd483ee9ba8997797eb963defcdf0ed07e67cb75ef1771c677f50e6f0d34f60f7748e490f0b83d428b31f0288a7ceb205e04a04fab32d110faad2bf867e736779da05cb785027f88d94729f9237c6c95897d391bc7268ee4cebab45c930f45f1bb50e6a68cf8521f5ed617b8c46617b4d8eb21bd6976104e1632905129d123f17ad2adef773b6e1b04be12a9bc2cb482ea3195d53863418947ffc7fcee8e762d192b6f3f2ccb1f0371c2ab343a959ca6b44666485b4afa2f1eb2aec7526678b3e3ebab44223d4cde59c54c06027de06f76f9abd888097a165b0cfa6d05d19c5515e73de27c511a7871b633cc92e7a5a8929e8161fd1db9099ecf7cefb3bbfa6001acc2e1a88e1a48ea22d20816de47f6e83d81d9bde61b5107dc2e0bfd27db6a1c37b4ced650e2c33c97b6eae5cca843cdbd999504cb01be2a8c8ca2ad7d42297c13e7d2dfc27ee9ed93d4bae8f0a2bbb4f907f6931b621364782f19b6b9451459095d7b37c2cfde5caa927240cf73f8f1bc64272f20849c7c16ea683011527cf9af77f85606105f207cc463554df1aaeb51781dc475c98f1f22d3bca73099107deedf5e3d13735a0ac6e1b883f1878381c5c2a34ef9dc0d291ea7fdb75bbd4d4a3a207697ee7e411906e271d75a4455c6c641dcf4b82e08b77babf3089e1a9bee8d91af479a29ee0b6b5c504944ecec53c3ee46bbf88ca8d9 +TAG = c1116fa7b6c9b73bc19740c9e89b2741 +FAILS = WRONG_NONCE_LENGTH + +# 2048 bytes plain text, 24 bytes key size, 3 bytes nonce size, 28 bytes AAD size +KEY = 3f570389de8af73dd46c7ac5cf7cb9d8f973e3e7911d721e +NONCE = 0a5deb +IN = 7ad7693b68af067638cb72d19af7efe29abaab6f4e7455b2e83a8a4a8faf18cf8701b11a4132ce924930fcb22b1a7c816c4a662e107a3616c9dfb8defcd99659db51b5b964a210bd4865c42108973e99a2ab93374325fe94f1b5ffbe75927ddf1a6ea24222cae9d35135452b3f72af49b9551a9ad7b2d8bca53e6c841653833cffb2ef71afd0d61739e6b1bd3da3f41946fd8c7b74a4c4704fe22977261ac03343c412b4626f9e7a516c2e03ac329299ceada15b05d2bc00bd1e2fabc73d8f1675c22a9d0b69aae6c7f6d2357207949da215a2e3a7bc71655193302ee9046cf09c7c0bac58bed86a8840092f7bd6ca61bef4a57b7ae072216501d1899232fc41c34d6d5b848497d33a3c454b2c7fb884eeb8e3af98b62aa7e39d2a5145995c63247bb45be5641a6891d25e2cf61e094de4cb7d562d711e9d651f3b4fc85c77cbcd2948ee537ccaefe3697bee7223ed2285383873e892eb50226545fa0247f0f5c28022c8dd955ad7370f06ff2b1d8ff6c9d7ddc6ae29144ea7faa217543fe33129b55a22081bb70aceff6565c2d23784fb8848124b8e4a50694caa4c142e6508197e82b59dca4662cce2eedc43dec46719546487f2a06610a95db3a80c199d6a584fba704fe345fddaf368564b4a6c1f45cfe13177e7b4c49fb6da8abd6809b044a60f20719c260cc2016ef369650e5fdc36693bc50f86d3f53671675983f5538be08a9d058cdad4a09d74f76f64f1a76a8aac6020bf5944c7673cd78994247179ff19686bbacd7d3f9ad038f223b9313d5ccd2b335c70fdf71f576fb18501d2aa57a23fb2dafe60378b19607d8f2efed4ec68933cd95f5abc1cbdda5f918c128078f7aa5858044082fa492102f7fafbede646ed0f81dd4f1537336b37a9e74d8c9501fffd5a0734ee0a61fff6d8f7c85bf7991eac514c5f72e90abf8b398d622b4967ca2956f7889f8ac79b50c138a5cbbd9e6fa7badde283216451097a9189cbb4590be06b78eca32d0168a5883d5e030839207dcc163295ee96a9b36c5ff9fb162952599efb9de087167c4294e1732d65d4521dec59dedaab0c4c31cef7bceb045019178c9ddfd25a866c620d8c4e70cdf309f55e544b3214c2da0e77e01a659250f4a05dc4cb5ede15b6effc845cc3a287672aa3d0de23394d079bfffec27236cef87cb120928665b6652e638a817de5028cb65389e9feab6f4c0c52a134fd4f1f8f9f6b376258885dc60829b2a8d0b289755aeba54c353365fb42259aaddf935a5776a48f3619f88a6042b185db81f753f2654044a73d9d996cc70b2929093719bfc46bbb5d1821bbae2c597953ee7a1806dee9a0b94378e12f2ea4b8996baac8d0091781a2d9c252d84e1203cf98ec51acf1381072c6a1fbe8f29c819df7152ed1dc2ef2d05bd7b08f9227984237a10180b3b8970e600037702213805f881b1d83c3eae4bf86bc8f3e09004c60e93e7023d7276e032cce58b499bce2e93671aab564e71f5f64cf4cc29dcf87746b797b45da5306de14e328117eb611a6b13d35c2aba9c6cda19724fbbbedbe15997ea3819e4f1a2b933b3e6b88e225fe4b2b0540448b8b6c59531445023dbd53b5784a34dffc5159a5157dbd35ceff35613c490670c05a8845b7331ee1f18a59264fd68d48f1a3eff725415015a730f9b9848e604df69b1df28f39c3e096071bf33698cd6e7d9f6f3b1d749ab8ad6769505688a296b014c471ea5d5396d04e72aba29a3f4b871eecf28f1a3354ead62125a76edd9d7a9e3dd7048a33d7719be6cc347892e78c200189f4847b695357044f6eabb3e67fc576c856607507b96b7f19926aa6681143ac06c64804ee31d58f8dbad3ed46a7c5ce4fb952caad46f624256b244deceacd14328d62e5008a8e1018bd3d972d9a8fe4cdc1e45f2d9e9fbcc9ca85f60e2a8ae67cc28da436fbe3ece33f1f14f518bb0f6ce518720533e81cfb61e620c0dcbb859e011b9b76f06ea3fedb7ffbe7a9ad47b63f9cbe3f9c81d6f8835dcef7bb2daf3349bac683e5ff486c4859283587bbd83f657b16a6eae75dd6d77035e125a498f51717bbe9cd4690384795804393f7aec6d8e2c61c4c557ba99df646678cd4e26013a4a5a31acdf6acfcf7961cf3a4f2911a4fea4f6b8a21f35451b5cda0d701822002e6c2b6355b866561ac4da99f700f76885421f80af07d8a96c85996923db97c79c5647667356a8053d0da3e34884506c26ba3be37c2974dab09fc8d2ace5a936318eb6f42aad435c88fbe153cdf7cbc142c5dc7333efa1a5fae212a97d5177169c269fbea21aaa7136125e27ae803cf7531b9dc848996c08c8c0038c3705135ad1c6aba327867d25b516910cf7b066671f44a3a6c9b73927413f43b7e5c21de1c4b00efa522fcb8c962f0f181586ca05ac3785de551ace1801ed347daac95562f98d1e3f399dee8c8abd07efa74adbd5c6d2351c3583ad923da7fab385ca1d4067aab22e6210d4c76b9dbdc1016312378191a4018be82318f344822d84b114770d61af5289a1c9096d38758b44d39a6f25eecfc9ce33bc3b3e01fb5304368277000a5608c0c2325332e70d1cbce19f7b38ff2c6b879b3ddb89074a03390c57bff54aa1aad94ac1d69010e29d80cc70c5f201400bb2d9fa9a599e2e3434e3835afc025b250b6eb9a720d3840dd68da8f1fd5b73dc756c7c3a5edb35dcdb7e8cb40c547911fc149c1c9b5a7354dc05a292f331fd6038c5816a309c4c094fdf9b249a78e62bb9a6d02cd060fcb884c5d1b4d6625682f17225f7698b0ba65dc98c70fb7757d618b749f68b3eb942d2225b1c6a40e6069ab5fb05af551cd291abe745a5bf9aefc9f41ce42031ebde558943159b4680f2f1d532971ec4c53639726293782128d57f1 +AD = da5301ccd6814c6857c0ab9c4cb234efc10eed1764a02e7030d8953d +CT = a024588ee7e538e1edf8827d985086a898ebaef481d0c828300b13c83feb7984f68c5858167e1ee6bbb880f68ef575ad6bcd9f00ad78365b1b33759d4913cfbea6ac11f76b8aea18a2c322662edb875bea2c4c7a2502b561d07295a32422db72fdc7991ea105cfe35730bd717cabf80cf2e34bd7a9064fda4b60c1aa4cda601d654cf89432759a80366c79daf35f18ced9fca51cbde79be02501b85089d18fc6b2b25cea53c58ada2bddfa1328b1e04d9c0b376072235ffe31594d311661f3a670e7878ff10fec8d1ecce8ab969e7b08a8e66d1e99e872be88a313f4e30015deb61caa43b06a7b68477a59cec7ac4b441c1001e3c19a0cff619935ac10c1763565e5b0ed648f57e50c5b476f3166fe754de29b396bb89903eecb44aa6badbd54e107370e2b31279891d3d8ab9455961a5221987871ffd5442b00718d7e4dda215d68c9b53c0c82b175ed131f4a01bff7bb8bcc8d2644329b67dcaf4b79256eccc2b3eab818b1ac51582cc497becf2d353e3b619fd02291ebc4f648fa4c728c4876df876377bc716d2f8fdd19a282aea8d582c8157431492b3bebe14f177904804f2b09b2ec8b8c5fbbf0ebb46a692cd8cb175c97970da58159bb25a54c5cec943055f793abbdbf0d18d4e6b892e0b05c7b248ec80fac43f5fda20b1f3eaf881344f6f15bd52538bf0068312c2f45adbde33f47b5f0b0d1c62c382e1f75268ac525d74585e2b6fe9838eaa5360c7ccbffd805d857e64899a8c0ab4af70de00969695bbc039b8aca4ab491567fed6144312378b572f801206e6a18bff78f302a02d4de50fb01e9177adc547e651d2fc407f0dad90047fdd49426d222f4a29c69f4dff02f89a96771071fb0155c95d8b77508d335222e2af81002d1aee2c2f0ed0e6de0032f1d49f7cf937bdbc663cb4e13e16dce27e9c1b5f32b774902b306350ed286c51be56dc2218ac35993394f35c62a7a31ce727f9b696734c0c88e5d616ce6f14cd91aff4afad8b69edbdc9dfe4a1497cc81422bfcab63ff4b240edbc5d926c9e1f2aa6ae58871deccc1d9b9d1b08a63e1b56dc344aaedc9860f9c1b6bf00d8c86da77628ad9c6c851eec70cb6cc402a88b9963496cba2ace67bb4f4786de75c79a9fc6e8b024179d579c1e84af6ed2233ef275c01fa201a777bfed86b89e6f00ff47bf2e7d41767ce84252812ec8404ba6941c664bf90e99896141852c6e1fe3f940ba9040595735f138ce4ef2553873719f69c523cbee97ac0069a7cbdc2ce2f9d3c4e17f75fa2fd870830dc007c6cd9c65e93185e131054a7fde5652a8d1dc12792cca0c159ca183772dfeb666d6b46add87f90df0163f6cbca4572f726f3391e32701bbc47a39b7999607e4713c2d613ab80e08b71bfebeb1edc734162fe2b1cacde0a1a03dcfdf5fe6dc700dc116719c38b752c8479f0b103bdef4fee84d3e6b1086eca0ad571e9c53ac3c00d009cd0cf12f31357bfd9fda24d06d851950b5e562b58984f81bcd1e4c0460be2c787b9e3106913f6860f3734d25d49833a7f187ed86588b9592206b355663b1d83a3c9be87e5a64d4f6c4d7eab88f6fd7dd8df44a36b5a80c8b195e5a1624efaecac5eeb623db7bd5d88988bd96d1755047a8a9d6f57715d36913397b42c4c28794106b9f13a9e6fb57c17b56d57c5e33eed2e582020010f0dfdd233241a379135ab8915f07c2f6bde78a0c9fe72bc87c18cdffcdc1b2356e7cc77dd75944ce10fb432e5600401ae34175ff7675ae9aaff9952186dbb43539bbd1816e0e67b6e9e9ea3b534494007e1120744b0676e1f65b986c16311525dba39fa7e808b85ef6ec25cdff097c0512c5246e7bb2b43d229cfca46ef1af1534615ec5dda68c83a297f61eec24a5d2efa21ebc7a6a50d9cbff78a46d95d8b8c853bf5d05d2a2bf48e3d8b6f19eb164ae790a90e7b762a5b123f4559f4c0e1f88954d3b7d041a59a4ef1756642c0c8a6a4e74db1bb5f3673c97c9ef5f940a2e0967f7df199535a989ece78c114da5c007ba18484e12afe0f45b956c4d2b69bb587765ee60d4a729d05ec290782f1997a587c0460d3c81967a1e3d2f4d17d06876877f6fa0874593a56d424477ae48c4fbde733f8aaa4fb464e666a8f4abc10c4fafdcfc0fcbe21db621c7e15db6375e8f38de1f96d0d3857d659aaadbc0a34b4e0b1191326b21634064ba325dad0b41320664e9996469b9858d6b4958d796c34d82e993705cb4bd4d87cf13056f7ce6c120d46ec43db0083f88519029f01ebc01d713595a84859843273a7bf9ebb16d3f69dcdbab0539d03425caef0cf588729562b0b32c9a75a1ef838de0f9a78bd4f6b708aa976ac4574e73b3485425934965faaf42511f26b40981e5767764edc1a5562e48472fb03f835d3b729b7d2885bbce604f5d00023a12c14aa2cc1a49c2cab955b733174b22ba7bebb72fb23c03ab5ce1894a4d9b2ec24e7c1b99064b478fbbd63211b515f43b91c04f3a0b8b86757344d99bcf22c924a3f69c10074fb9a23a5683644ef0a4364a54502332842ee4a40a2186de4bb3c05cc7637773b2d9c947984312206d8cb5f450188779f539f6bd52a971085f5d32221342c9783923446dac353695fc31d9f3604f8255b09edc638051bffcd46f234999079c74d4ee28a051dfe60a8a079bcb897f8b7bc5b92aab29321b15147c051bb665f3ec3b642e2a2cab7b68bce81ebb05af5e73897bf1edebcc77f553019a1141010d38a681fd8b07d79696a00a72be2270fbe75309ded6ab226b1cc7caa57781f81c6e3baf716731b681b73b0646fdb612f619b296a7d2bb4db79518a5e5a2f22361f9e563f67c78a100200e4a5cff904aa7a20636a4d3c874ef9fe9b4462d1b7bbf976fcd96d7edfd2feb39e +TAG = 8ee99f8871557e7ac0332d8b725435a3 +FAILS = WRONG_NONCE_LENGTH From 12eed68fff075a7a1f3652ac10cefba0466e5e9f Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 5 Dec 2024 14:14:25 -0500 Subject: [PATCH 3/7] Add cipher::AES_192 --- aws-lc-rs/src/aead/quic.rs | 6 ++--- aws-lc-rs/src/cipher.rs | 50 ++++++++++++++++++++++++++----------- aws-lc-rs/src/cipher/aes.rs | 42 +++++++++++++++---------------- aws-lc-rs/src/cipher/key.rs | 39 ++++++++++++++++++++++++++++- 4 files changed, 97 insertions(+), 40 deletions(-) diff --git a/aws-lc-rs/src/aead/quic.rs b/aws-lc-rs/src/aead/quic.rs index 5e71dee22e3..ac319fe7133 100644 --- a/aws-lc-rs/src/aead/quic.rs +++ b/aws-lc-rs/src/aead/quic.rs @@ -148,9 +148,9 @@ fn cipher_new_mask( let block = block::Block::from(sample); let encrypted_block = match cipher_key { - SymmetricCipherKey::Aes128 { enc_key, .. } | SymmetricCipherKey::Aes256 { enc_key, .. } => { - encrypt_block(enc_key, block) - } + SymmetricCipherKey::Aes128 { enc_key, .. } + | SymmetricCipherKey::Aes192 { enc_key, .. } + | SymmetricCipherKey::Aes256 { enc_key, .. } => encrypt_block(enc_key, block), SymmetricCipherKey::ChaCha20 { raw_key } => { let plaintext = block.as_ref(); let counter_bytes: &[u8; 4] = plaintext[0..=3] diff --git a/aws-lc-rs/src/cipher.rs b/aws-lc-rs/src/cipher.rs index 14990e19a04..938161dac7c 100644 --- a/aws-lc-rs/src/cipher.rs +++ b/aws-lc-rs/src/cipher.rs @@ -235,8 +235,9 @@ use crate::hkdf::KeyType; use crate::iv::{FixedLength, IV_LEN_128_BIT}; use crate::ptr::ConstPointer; use aws_lc::{ - EVP_aes_128_cbc, EVP_aes_128_cfb128, EVP_aes_128_ctr, EVP_aes_128_ecb, EVP_aes_256_cbc, - EVP_aes_256_cfb128, EVP_aes_256_ctr, EVP_aes_256_ecb, EVP_CIPHER, + EVP_aes_128_cbc, EVP_aes_128_cfb128, EVP_aes_128_ctr, EVP_aes_128_ecb, EVP_aes_192_cbc, + EVP_aes_192_cfb128, EVP_aes_192_ctr, EVP_aes_192_ecb, EVP_aes_256_cbc, EVP_aes_256_cfb128, + EVP_aes_256_ctr, EVP_aes_256_ecb, EVP_CIPHER, }; use core::fmt::Debug; use key::SymmetricCipherKey; @@ -244,6 +245,9 @@ use key::SymmetricCipherKey; /// The number of bytes in an AES 128-bit key pub use crate::cipher::aes::AES_128_KEY_LEN; +/// The number of bytes in an AES 192-bit key +pub use crate::cipher::aes::AES_192_KEY_LEN; + /// The number of bytes in an AES 256-bit key pub use crate::cipher::aes::AES_256_KEY_LEN; @@ -287,6 +291,10 @@ impl OperatingMode { (OperatingMode::CTR, AlgorithmId::Aes128) => unsafe { EVP_aes_128_ctr() }, (OperatingMode::CFB128, AlgorithmId::Aes128) => unsafe { EVP_aes_128_cfb128() }, (OperatingMode::ECB, AlgorithmId::Aes128) => unsafe { EVP_aes_128_ecb() }, + (OperatingMode::CBC, AlgorithmId::Aes192) => unsafe { EVP_aes_192_cbc() }, + (OperatingMode::CTR, AlgorithmId::Aes192) => unsafe { EVP_aes_192_ctr() }, + (OperatingMode::CFB128, AlgorithmId::Aes192) => unsafe { EVP_aes_192_cfb128() }, + (OperatingMode::ECB, AlgorithmId::Aes192) => unsafe { EVP_aes_192_ecb() }, (OperatingMode::CBC, AlgorithmId::Aes256) => unsafe { EVP_aes_256_cbc() }, (OperatingMode::CTR, AlgorithmId::Aes256) => unsafe { EVP_aes_256_ctr() }, (OperatingMode::CFB128, AlgorithmId::Aes256) => unsafe { EVP_aes_256_cfb128() }, @@ -347,10 +355,14 @@ define_cipher_context!(DecryptionContext, EncryptionContext); /// Cipher algorithm identifier. pub enum AlgorithmId { /// AES 128-bit - Aes128, + Aes128 = 0, + + // Discriminant explicitly set due to changing implicit discriminant would break semver + /// AES 192-bit + Aes192 = 2, /// AES 256-bit - Aes256, + Aes256 = 1, } /// A cipher algorithm. @@ -368,6 +380,13 @@ pub static AES_128: Algorithm = Algorithm { block_len: AES_BLOCK_LEN, }; +/// AES 192-bit cipher +pub static AES_192: Algorithm = Algorithm { + id: AlgorithmId::Aes192, + key_len: AES_192_KEY_LEN, + block_len: AES_BLOCK_LEN, +}; + /// AES 256-bit cipher pub static AES_256: Algorithm = Algorithm { id: AlgorithmId::Aes256, @@ -392,7 +411,7 @@ impl Algorithm { ) -> Result { match self.id { // TODO: Hopefully support CFB1, and CFB8 - AlgorithmId::Aes128 | AlgorithmId::Aes256 => match mode { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => match mode { OperatingMode::CBC | OperatingMode::CTR | OperatingMode::CFB128 => { Ok(EncryptionContext::Iv128(FixedLength::new()?)) } @@ -404,7 +423,7 @@ impl Algorithm { fn is_valid_encryption_context(&self, mode: OperatingMode, input: &EncryptionContext) -> bool { match self.id { // TODO: Hopefully support CFB1, and CFB8 - AlgorithmId::Aes128 | AlgorithmId::Aes256 => match mode { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => match mode { OperatingMode::CBC | OperatingMode::CTR | OperatingMode::CFB128 => { matches!(input, EncryptionContext::Iv128(_)) } @@ -418,7 +437,7 @@ impl Algorithm { fn is_valid_decryption_context(&self, mode: OperatingMode, input: &DecryptionContext) -> bool { // TODO: Hopefully support CFB1, and CFB8 match self.id { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => match mode { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => match mode { OperatingMode::CBC | OperatingMode::CTR | OperatingMode::CFB128 => { matches!(input, DecryptionContext::Iv128(_)) } @@ -489,6 +508,7 @@ impl TryInto for UnboundCipherKey { fn try_into(self) -> Result { match self.algorithm.id() { AlgorithmId::Aes128 => SymmetricCipherKey::aes128(self.key_bytes.as_ref()), + AlgorithmId::Aes192 => SymmetricCipherKey::aes192(self.key_bytes.as_ref()), AlgorithmId::Aes256 => SymmetricCipherKey::aes256(self.key_bytes.as_ref()), } } @@ -739,23 +759,23 @@ fn encrypt( match mode { OperatingMode::CBC => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::encrypt_cbc_mode(key, context, in_out) } }, OperatingMode::CTR => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::encrypt_ctr_mode(key, context, in_out) } }, // TODO: Hopefully support CFB1, and CFB8 OperatingMode::CFB128 => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::encrypt_cfb_mode(key, mode, context, in_out) } }, OperatingMode::ECB => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::encrypt_ecb_mode(key, context, in_out) } }, @@ -782,23 +802,23 @@ fn decrypt<'in_out>( match mode { OperatingMode::CBC => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::decrypt_cbc_mode(key, context, in_out) } }, OperatingMode::CTR => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::decrypt_ctr_mode(key, context, in_out) } }, // TODO: Hopefully support CFB1, and CFB8 OperatingMode::CFB128 => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::decrypt_cfb_mode(key, mode, context, in_out) } }, OperatingMode::ECB => match algorithm.id() { - AlgorithmId::Aes128 | AlgorithmId::Aes256 => { + AlgorithmId::Aes128 | AlgorithmId::Aes192 | AlgorithmId::Aes256 => { aes::decrypt_ecb_mode(key, context, in_out) } }, diff --git a/aws-lc-rs/src/cipher/aes.rs b/aws-lc-rs/src/cipher/aes.rs index 0bea1657180..e189cb62799 100644 --- a/aws-lc-rs/src/cipher/aes.rs +++ b/aws-lc-rs/src/cipher/aes.rs @@ -49,9 +49,9 @@ pub(super) fn encrypt_ctr_mode( ) -> Result { #[allow(clippy::match_wildcard_for_single_variants)] let key = match &key { - SymmetricCipherKey::Aes128 { enc_key, .. } | SymmetricCipherKey::Aes256 { enc_key, .. } => { - enc_key - } + SymmetricCipherKey::Aes128 { enc_key, .. } + | SymmetricCipherKey::Aes192 { enc_key, .. } + | SymmetricCipherKey::Aes256 { enc_key, .. } => enc_key, _ => unreachable!(), }; @@ -85,9 +85,9 @@ pub(super) fn encrypt_cbc_mode( ) -> Result { #[allow(clippy::match_wildcard_for_single_variants)] let key = match &key { - SymmetricCipherKey::Aes128 { enc_key, .. } | SymmetricCipherKey::Aes256 { enc_key, .. } => { - enc_key - } + SymmetricCipherKey::Aes128 { enc_key, .. } + | SymmetricCipherKey::Aes192 { enc_key, .. } + | SymmetricCipherKey::Aes256 { enc_key, .. } => enc_key, _ => unreachable!(), }; @@ -111,9 +111,9 @@ pub(super) fn decrypt_cbc_mode<'in_out>( ) -> Result<&'in_out mut [u8], Unspecified> { #[allow(clippy::match_wildcard_for_single_variants)] let key = match &key { - SymmetricCipherKey::Aes128 { dec_key, .. } | SymmetricCipherKey::Aes256 { dec_key, .. } => { - dec_key - } + SymmetricCipherKey::Aes128 { dec_key, .. } + | SymmetricCipherKey::Aes192 { dec_key, .. } + | SymmetricCipherKey::Aes256 { dec_key, .. } => dec_key, _ => unreachable!(), }; @@ -138,9 +138,9 @@ pub(super) fn encrypt_cfb_mode( ) -> Result { #[allow(clippy::match_wildcard_for_single_variants)] let key = match &key { - SymmetricCipherKey::Aes128 { enc_key, .. } | SymmetricCipherKey::Aes256 { enc_key, .. } => { - enc_key - } + SymmetricCipherKey::Aes128 { enc_key, .. } + | SymmetricCipherKey::Aes192 { enc_key, .. } + | SymmetricCipherKey::Aes256 { enc_key, .. } => enc_key, _ => unreachable!(), }; @@ -171,9 +171,9 @@ pub(super) fn decrypt_cfb_mode<'in_out>( ) -> Result<&'in_out mut [u8], Unspecified> { #[allow(clippy::match_wildcard_for_single_variants)] let key = match &key { - SymmetricCipherKey::Aes128 { enc_key, .. } | SymmetricCipherKey::Aes256 { enc_key, .. } => { - enc_key - } + SymmetricCipherKey::Aes128 { enc_key, .. } + | SymmetricCipherKey::Aes192 { enc_key, .. } + | SymmetricCipherKey::Aes256 { enc_key, .. } => enc_key, _ => unreachable!(), }; @@ -208,9 +208,9 @@ pub(super) fn encrypt_ecb_mode( #[allow(clippy::match_wildcard_for_single_variants)] let key = match &key { - SymmetricCipherKey::Aes128 { enc_key, .. } | SymmetricCipherKey::Aes256 { enc_key, .. } => { - enc_key - } + SymmetricCipherKey::Aes128 { enc_key, .. } + | SymmetricCipherKey::Aes192 { enc_key, .. } + | SymmetricCipherKey::Aes256 { enc_key, .. } => enc_key, _ => unreachable!(), }; @@ -239,9 +239,9 @@ pub(super) fn decrypt_ecb_mode<'in_out>( #[allow(clippy::match_wildcard_for_single_variants)] let key = match &key { - SymmetricCipherKey::Aes128 { dec_key, .. } | SymmetricCipherKey::Aes256 { dec_key, .. } => { - dec_key - } + SymmetricCipherKey::Aes128 { dec_key, .. } + | SymmetricCipherKey::Aes192 { dec_key, .. } + | SymmetricCipherKey::Aes256 { dec_key, .. } => dec_key, _ => unreachable!(), }; diff --git a/aws-lc-rs/src/cipher/key.rs b/aws-lc-rs/src/cipher/key.rs index 73ed178c0fd..03c51cc577b 100644 --- a/aws-lc-rs/src/cipher/key.rs +++ b/aws-lc-rs/src/cipher/key.rs @@ -3,7 +3,7 @@ use crate::cipher::block::Block; use crate::cipher::chacha::ChaCha20Key; -use crate::cipher::{AES_128_KEY_LEN, AES_256_KEY_LEN}; +use crate::cipher::{AES_128_KEY_LEN, AES_192_KEY_LEN, AES_256_KEY_LEN}; use crate::error::Unspecified; use aws_lc::{AES_set_decrypt_key, AES_set_encrypt_key, AES_KEY}; use core::mem::{size_of, MaybeUninit}; @@ -15,6 +15,7 @@ use zeroize::Zeroize; pub(crate) enum SymmetricCipherKey { Aes128 { enc_key: AES_KEY, dec_key: AES_KEY }, + Aes192 { enc_key: AES_KEY, dec_key: AES_KEY }, Aes256 { enc_key: AES_KEY, dec_key: AES_KEY }, ChaCha20 { raw_key: ChaCha20Key }, } @@ -29,6 +30,7 @@ impl Drop for SymmetricCipherKey { // Aes128Key, Aes256Key and ChaCha20Key implement Drop separately. match self { SymmetricCipherKey::Aes128 { enc_key, dec_key } + | SymmetricCipherKey::Aes192 { enc_key, dec_key } | SymmetricCipherKey::Aes256 { enc_key, dec_key } => unsafe { let enc_bytes: &mut [u8; size_of::()] = (enc_key as *mut AES_KEY) .cast::<[u8; size_of::()]>() @@ -81,6 +83,40 @@ impl SymmetricCipherKey { } } + pub(crate) fn aes192(key_bytes: &[u8]) -> Result { + if key_bytes.len() != AES_192_KEY_LEN { + return Err(Unspecified); + } + + unsafe { + let mut enc_key = MaybeUninit::::uninit(); + #[allow(clippy::cast_possible_truncation)] + if 0 != AES_set_encrypt_key( + key_bytes.as_ptr(), + (key_bytes.len() * 8) as c_uint, + enc_key.as_mut_ptr(), + ) { + return Err(Unspecified); + } + let enc_key = enc_key.assume_init(); + + let mut dec_key = MaybeUninit::::uninit(); + #[allow(clippy::cast_possible_truncation)] + if 0 != AES_set_decrypt_key( + key_bytes.as_ptr(), + (key_bytes.len() * 8) as c_uint, + dec_key.as_mut_ptr(), + ) { + return Err(Unspecified); + } + let dec_key = dec_key.assume_init(); + + let mut kb = MaybeUninit::<[u8; AES_192_KEY_LEN]>::uninit(); + copy_nonoverlapping(key_bytes.as_ptr(), kb.as_mut_ptr().cast(), AES_192_KEY_LEN); + Ok(SymmetricCipherKey::Aes192 { enc_key, dec_key }) + } + } + pub(crate) fn aes256(key_bytes: &[u8]) -> Result { if key_bytes.len() != AES_256_KEY_LEN { return Err(Unspecified); @@ -132,6 +168,7 @@ impl SymmetricCipherKey { pub(crate) fn encrypt_block(&self, block: Block) -> Block { match self { SymmetricCipherKey::Aes128 { enc_key, .. } + | SymmetricCipherKey::Aes192 { enc_key, .. } | SymmetricCipherKey::Aes256 { enc_key, .. } => { super::aes::encrypt_block(enc_key, block) } From 767e6eea622a6bdbfbe13563f938254f422d7050 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 5 Dec 2024 15:08:06 -0500 Subject: [PATCH 4/7] Testing for AES_192 --- aws-lc-rs/tests/cipher_test.rs | 174 ++++++++++++++++++++++++++++++++- 1 file changed, 173 insertions(+), 1 deletion(-) diff --git a/aws-lc-rs/tests/cipher_test.rs b/aws-lc-rs/tests/cipher_test.rs index 4d496e69087..820ade41fc6 100644 --- a/aws-lc-rs/tests/cipher_test.rs +++ b/aws-lc-rs/tests/cipher_test.rs @@ -4,7 +4,7 @@ use aws_lc_rs::cipher::{ DecryptingKey, DecryptionContext, EncryptingKey, EncryptionContext, OperatingMode, PaddedBlockDecryptingKey, PaddedBlockEncryptingKey, StreamingDecryptingKey, - StreamingEncryptingKey, UnboundCipherKey, AES_128, AES_256, + StreamingEncryptingKey, UnboundCipherKey, AES_128, AES_192, AES_256, }; use aws_lc_rs::iv::{FixedLength, IV_LEN_128_BIT}; use aws_lc_rs::test::from_hex; @@ -505,6 +505,17 @@ padded_cipher_kat!( "69c4e0d86a7b0430d8cdb78070b4c55a9e978e6d16b086570ef794ef97984232" ); +padded_cipher_kat!( + test_kat_aes_192_cbc_16_bytes, + &AES_192, + OperatingMode::CBC, + cbc_pkcs7, + "e08c15411774ec4a908b64eadc6ac4199c7cd453f3aaef53", + "00000000000000000000000000000000", + "00112233445566778899aabbccddeeff", + "fc7f57e545e92c0a0b364c3086d49bf0f1a1a203743fbd8af828af46edca074d" +); + padded_cipher_kat!( test_kat_aes_256_cbc_15_bytes, &AES_256, @@ -527,6 +538,17 @@ cipher_kat!( "c6b01904c3da3df5e7d62bd96d153686" ); +cipher_kat!( + test_kat_aes_192_ctr_16_bytes, + &AES_192, + OperatingMode::CTR, + ctr, + "cd62376d5ebb414917f0c78f05266433dc9192a1ec943300", + "00000000000000000000000000000000", + "00112233445566778899aabbccddeeff", + "7f7d07cc05d0e31633fb59df5e34d2d6" +); + cipher_kat!( test_kat_aes_256_ctr_15_bytes, &AES_256, @@ -549,6 +571,17 @@ cipher_kat!( "bd7d928f60e3422d96b3f8cd614eb2" ); +cipher_kat!( + test_kat_aes_192_ctr_15_bytes, + &AES_192, + OperatingMode::CTR, + ctr, + "25a39dbfd8034f71a81f9ceb55026e4037f8f6aa30ab44ce", + "ffffffffffffffffffffffffffffff80", + "3ee38cec171e6cf466bf0df98aa0e1", + "56caf80166f076dfee89adc73b71e5" +); + cipher_kat!( test_kat_aes_256_ctr_15_bytes_2, &AES_256, @@ -571,6 +604,17 @@ padded_cipher_kat!( "ad96993f248bd6a29760ec7ccda95ee1" ); +padded_cipher_kat!( + test_kat_aes_192_cbc_15_bytes, + &AES_192, + OperatingMode::CBC, + cbc_pkcs7, + "7001c487cc3e572cfc92f4d0e697d982e8856fdcc957da40", + "b5313560244a4822c46c2a0c9d0cf7fd", + "a3e4c990356c01f320043c3d8d6f43", + "33549957df6ff5cf32ca59b42298f4d5" +); + padded_cipher_kat!( test_kat_aes_128_cbc_16_bytes_2, &AES_128, @@ -602,6 +646,15 @@ padded_cipher_rt!( "00112233445566778899aabbccddeeff" ); +padded_cipher_rt!( + test_rt_aes_192_cbc_16_bytes, + &AES_192, + OperatingMode::CBC, + cbc_pkcs7, + "d2926527e0aa9f37b45e2ec2ade5853ef807576104c7ace3", + "00112233445566778899aabbccddeeff" +); + padded_cipher_rt!( test_rt_aes_256_cbc_15_bytes, &AES_256, @@ -620,6 +673,15 @@ cipher_rt!( "00112233445566778899aabbccddeeff" ); +cipher_rt!( + test_rt_aes_192_ctr_16_bytes, + &AES_192, + OperatingMode::CTR, + ctr, + "982215f4e173dfa0fcffe5d3da41c4812c7bcc8ed3540f93", + "00112233445566778899aabbccddeeff" +); + cipher_rt!( test_rt_aes_128_ctr_17_bytes, &AES_128, @@ -629,6 +691,15 @@ cipher_rt!( "00112233445566778899aabbccddeeff01" ); +cipher_rt!( + test_rt_aes_192_ctr_17_bytes, + &AES_192, + OperatingMode::CTR, + ctr, + "98c6b8e01e379fbd14e61af6af891596583565f2a27d59e9", + "00112233445566778899aabbccddeeff01" +); + cipher_rt!( test_rt_aes_256_ctr_15_bytes, &AES_256, @@ -647,6 +718,15 @@ cipher_rt!( "3ee38cec171e6cf466bf0df98aa0e1" ); +cipher_rt!( + test_rt_aes_192_ctr_15_bytes, + &AES_192, + OperatingMode::CTR, + ctr, + "b3ad5cea1dddc214ca969ac35f37dae1a9a9d1528f89bb35", + "3ee38cec171e6cf466bf0df98aa0e1" +); + cipher_rt!( test_rt_aes_256_ctr_15_bytes_2, &AES_256, @@ -674,6 +754,15 @@ padded_cipher_rt!( "a3e4c990356c01f320043c3d8d6f43" ); +padded_cipher_rt!( + test_rt_aes_192_cbc_15_bytes, + &AES_192, + OperatingMode::CBC, + cbc_pkcs7, + "45899367c3132849763073c435a9288a766c8b9ec2308516", + "a3e4c990356c01f320043c3d8d6f43" +); + padded_cipher_rt!( test_rt_aes_128_cbc_16_bytes_2, &AES_128, @@ -692,6 +781,15 @@ padded_cipher_rt!( "aece7b5e3c3df1ffc9802d2dfe296dc734" ); +padded_cipher_rt!( + test_rt_192_cbc_17_bytes, + &AES_192, + OperatingMode::CBC, + cbc_pkcs7, + "ec250e04c3903f602647b85a401a1ae7ca2f02f67fa4253e", + "aece7b5e3c3df1ffc9802d2dfe296dc734" +); + padded_cipher_rt!( test_rt_aes_256_cbc_16_bytes, &AES_256, @@ -718,6 +816,14 @@ padded_ecb_pkcs7_kat!( "e5e18734e84530de94b1636d938e5d6f6b4027b4321685a9195b4ddbf25530bf" ); +padded_ecb_pkcs7_kat!( + test_kat_aes_192_ecb_pkcs7_16_bytes, + &AES_192, + "d077a03bd8a38973928ccafe4a9d2f455130bd0af5ae46a9", + "61f17a594bd5b55ae3fa8efaae6e83d6", + "2379bbaa72d82275688301f5cb6ac1898c1ea2c8cd120dc19cdefcc3d477fce4" +); + padded_ecb_pkcs7_kat!( test_kat_aes_128_ecb_pkcs7_15_bytes, &AES_128, @@ -726,6 +832,14 @@ padded_ecb_pkcs7_kat!( "593a39d148e106ebc4a429b97b5033bc" ); +padded_ecb_pkcs7_kat!( + test_kat_aes_192_ecb_pkcs7_15_bytes, + &AES_192, + "d184c36cf0dddfec39e654195006022237871a47c33d3198", + "4badb333837326d75406a0cd6149f0", + "45f7cea9d1d21ade4fc31ff0c4ebf4c7" +); + padded_ecb_pkcs7_kat!( test_kat_aes_256_ecb_pkcs7_16_bytes, &AES_256, @@ -750,6 +864,14 @@ ecb_kat!( "1eea416d959f747da26d48d2df11d205" ); +ecb_kat!( + test_kat_aes_192_ecb_16_bytes, + &AES_192, + "4c6994ffa9dcdc805b60c2c0095334c42d95a8fc0ca5b080", + "c4a500e39307dbe7727b5b3a36660f70", + "1f021658980c025396455f7bb7e01d07" +); + ecb_kat!( test_kat_aes_128_ecb_15_bytes, &AES_128, @@ -757,6 +879,13 @@ ecb_kat!( "c4a500e39307dbe7727b5b3a36660f" ); +ecb_kat!( + test_kat_aes_192_ecb_15_bytes, + &AES_192, + "c88f5b00a4ef9a6840e2acaf33f00a3bdc4e25895303fa72", + "c4a500e39307dbe7727b5b3a36660f" +); + ecb_kat!( test_kat_aes_256_ecb_16_bytes, &AES_256, @@ -779,6 +908,13 @@ ecb_rt!( "81c7241bbbf37d9b50e5072858fc498d" ); +ecb_rt!( + test_rt_aes_192_16_bytes, + &AES_192, + "e9f065d7c13573587f7875357dfbb16c53489f6a4bd0f7cd", + "81c7241bbbf37d9b50e5072858fc498d" +); + ecb_rt!( test_rt_aes_256_16_bytes, &AES_256, @@ -793,6 +929,13 @@ padded_ecb_pkcs7_rt!( "e6a32546cb537cf589ac65aac84815ae" ); +padded_ecb_pkcs7_rt!( + test_rt_aes_192_ecb_pkcs7_16_bytes, + &AES_192, + "15d20f6ebc7e649fd95b76b107e6daba967c8a9484797f29", + "e6a32546cb537cf589ac65aac84815ae" +); + padded_ecb_pkcs7_rt!( test_rt_aes_128_ecb_pkcs7_15_bytes, &AES_128, @@ -800,6 +943,13 @@ padded_ecb_pkcs7_rt!( "6194b065db9003381c0c736130188e" ); +padded_ecb_pkcs7_rt!( + test_rt_aes_192_ecb_pkcs7_15_bytes, + &AES_192, + "a8a282ee31c03fae4f8e9b8930d5473c2ed695a347e88b7c", + "6194b065db9003381c0c736130188e" +); + padded_ecb_pkcs7_rt!( test_rt_aes_256_ecb_pkcs7_16_bytes, &AES_256, @@ -836,6 +986,28 @@ cipher_kat!( "187a9d7d922afa9f3294ad12669df1" ); +cipher_kat!( + test_kat_aes_192_cfb128_16_bytes, + &AES_192, + OperatingMode::CFB128, + cfb128, + "cd62376d5ebb414917f0c78f05266433dc9192a1ec943300", + "dd41c2fb73e61bdc02da6c70eb5ac729", + "6a841482cf079c4a4b8c59b6c6bda6a4", + "35f27d6902d635ac4f664e2367fcd686" +); + +cipher_kat!( + test_kat_aes_192_cfb128_15_bytes, + &AES_192, + OperatingMode::CFB128, + cfb128, + "502a6ab36984af268bf423c7f509205207fc1552af4a91e5", + "bbdeef0d1837c33971f04eb0a8cde0a2", + "750cf377093fb05f84875a240154f7", + "6c650820cd06ca89aa96c07e16e717" +); + cipher_kat!( test_kat_aes_256_cfb128_16_bytes, &AES_256, From b1ce1ccb07b7194f72f267df3b281ddc3acbf79b Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Fri, 6 Dec 2024 09:09:42 -0500 Subject: [PATCH 5/7] Cleanup SymmetricCipherKey construction --- aws-lc-rs/src/cipher/key.rs | 106 ++++++++++-------------------------- 1 file changed, 28 insertions(+), 78 deletions(-) diff --git a/aws-lc-rs/src/cipher/key.rs b/aws-lc-rs/src/cipher/key.rs index 03c51cc577b..b24549f37b8 100644 --- a/aws-lc-rs/src/cipher/key.rs +++ b/aws-lc-rs/src/cipher/key.rs @@ -49,105 +49,55 @@ impl Drop for SymmetricCipherKey { } impl SymmetricCipherKey { - pub(crate) fn aes128(key_bytes: &[u8]) -> Result { - if key_bytes.len() != AES_128_KEY_LEN { - return Err(Unspecified); - } - - unsafe { - let mut enc_key = MaybeUninit::::uninit(); - #[allow(clippy::cast_possible_truncation)] - if 0 != AES_set_encrypt_key( + fn aes(key_bytes: &[u8]) -> Result<(AES_KEY, AES_KEY), Unspecified> { + let mut enc_key = MaybeUninit::::uninit(); + let mut dec_key = MaybeUninit::::uninit(); + #[allow(clippy::cast_possible_truncation)] + if unsafe { + 0 != AES_set_encrypt_key( key_bytes.as_ptr(), (key_bytes.len() * 8) as c_uint, enc_key.as_mut_ptr(), - ) { - return Err(Unspecified); - } - let enc_key = enc_key.assume_init(); + ) + } { + return Err(Unspecified); + } - let mut dec_key = MaybeUninit::::uninit(); - #[allow(clippy::cast_possible_truncation)] - if 0 != AES_set_decrypt_key( + #[allow(clippy::cast_possible_truncation)] + if unsafe { + 0 != AES_set_decrypt_key( key_bytes.as_ptr(), (key_bytes.len() * 8) as c_uint, dec_key.as_mut_ptr(), - ) { - return Err(Unspecified); - } - let dec_key = dec_key.assume_init(); + ) + } { + return Err(Unspecified); + } + unsafe { Ok((enc_key.assume_init(), dec_key.assume_init())) } + } - let mut kb = MaybeUninit::<[u8; AES_128_KEY_LEN]>::uninit(); - copy_nonoverlapping(key_bytes.as_ptr(), kb.as_mut_ptr().cast(), AES_128_KEY_LEN); - Ok(SymmetricCipherKey::Aes128 { enc_key, dec_key }) + pub(crate) fn aes128(key_bytes: &[u8]) -> Result { + if key_bytes.len() != AES_128_KEY_LEN { + return Err(Unspecified); } + let (enc_key, dec_key) = SymmetricCipherKey::aes(key_bytes)?; + Ok(SymmetricCipherKey::Aes128 { enc_key, dec_key }) } pub(crate) fn aes192(key_bytes: &[u8]) -> Result { if key_bytes.len() != AES_192_KEY_LEN { return Err(Unspecified); } - - unsafe { - let mut enc_key = MaybeUninit::::uninit(); - #[allow(clippy::cast_possible_truncation)] - if 0 != AES_set_encrypt_key( - key_bytes.as_ptr(), - (key_bytes.len() * 8) as c_uint, - enc_key.as_mut_ptr(), - ) { - return Err(Unspecified); - } - let enc_key = enc_key.assume_init(); - - let mut dec_key = MaybeUninit::::uninit(); - #[allow(clippy::cast_possible_truncation)] - if 0 != AES_set_decrypt_key( - key_bytes.as_ptr(), - (key_bytes.len() * 8) as c_uint, - dec_key.as_mut_ptr(), - ) { - return Err(Unspecified); - } - let dec_key = dec_key.assume_init(); - - let mut kb = MaybeUninit::<[u8; AES_192_KEY_LEN]>::uninit(); - copy_nonoverlapping(key_bytes.as_ptr(), kb.as_mut_ptr().cast(), AES_192_KEY_LEN); - Ok(SymmetricCipherKey::Aes192 { enc_key, dec_key }) - } + let (enc_key, dec_key) = SymmetricCipherKey::aes(key_bytes)?; + Ok(SymmetricCipherKey::Aes192 { enc_key, dec_key }) } pub(crate) fn aes256(key_bytes: &[u8]) -> Result { if key_bytes.len() != AES_256_KEY_LEN { return Err(Unspecified); } - unsafe { - let mut enc_key = MaybeUninit::::uninit(); - #[allow(clippy::cast_possible_truncation)] - if 0 != AES_set_encrypt_key( - key_bytes.as_ptr(), - (key_bytes.len() * 8) as c_uint, - enc_key.as_mut_ptr(), - ) { - return Err(Unspecified); - } - let enc_key = enc_key.assume_init(); - - let mut dec_key = MaybeUninit::::uninit(); - #[allow(clippy::cast_possible_truncation)] - if 0 != AES_set_decrypt_key( - key_bytes.as_ptr(), - (key_bytes.len() * 8) as c_uint, - dec_key.as_mut_ptr(), - ) { - return Err(Unspecified); - } - let dec_key = dec_key.assume_init(); - - let mut kb = MaybeUninit::<[u8; AES_256_KEY_LEN]>::uninit(); - copy_nonoverlapping(key_bytes.as_ptr(), kb.as_mut_ptr().cast(), AES_256_KEY_LEN); - Ok(SymmetricCipherKey::Aes256 { enc_key, dec_key }) - } + let (enc_key, dec_key) = SymmetricCipherKey::aes(key_bytes)?; + Ok(SymmetricCipherKey::Aes256 { enc_key, dec_key }) } pub(crate) fn chacha20(key_bytes: &[u8]) -> Result { From a00880f42a2315d2a4fe71e53e394ff9c9604356 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Fri, 6 Dec 2024 09:40:34 -0500 Subject: [PATCH 6/7] Update FIPS test & example --- aws-lc-rs/examples/cipher.rs | 4 ++- aws-lc-rs/src/cipher/tests/fips.rs | 40 +++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/aws-lc-rs/examples/cipher.rs b/aws-lc-rs/examples/cipher.rs index b5a4debde8e..96cc976547d 100644 --- a/aws-lc-rs/examples/cipher.rs +++ b/aws-lc-rs/examples/cipher.rs @@ -28,7 +28,8 @@ use aws_lc_rs::{ cipher::{ DecryptingKey, DecryptionContext, EncryptingKey, EncryptionContext, PaddedBlockDecryptingKey, PaddedBlockEncryptingKey, UnboundCipherKey, AES_128, - AES_128_KEY_LEN, AES_256, AES_256_KEY_LEN, AES_CBC_IV_LEN, AES_CTR_IV_LEN, + AES_128_KEY_LEN, AES_192, AES_192_KEY_LEN, AES_256, AES_256_KEY_LEN, AES_CBC_IV_LEN, + AES_CTR_IV_LEN, }, iv::FixedLength, }; @@ -262,6 +263,7 @@ fn aes_cbc_decrypt(key: String, iv: String, ciphertext: String) -> Result<(), &' fn new_unbound_key(key: &[u8]) -> Result { let alg = match key.len() { AES_128_KEY_LEN => &AES_128, + AES_192_KEY_LEN => &AES_192, AES_256_KEY_LEN => &AES_256, _ => { return Err("invalid aes key length"); diff --git a/aws-lc-rs/src/cipher/tests/fips.rs b/aws-lc-rs/src/cipher/tests/fips.rs index 6953f6a7529..77f5a9a5bd4 100644 --- a/aws-lc-rs/src/cipher/tests/fips.rs +++ b/aws-lc-rs/src/cipher/tests/fips.rs @@ -6,7 +6,8 @@ use crate::{ cipher::{ DecryptingKey, EncryptingKey, PaddedBlockDecryptingKey, PaddedBlockEncryptingKey, - StreamingDecryptingKey, StreamingEncryptingKey, UnboundCipherKey, AES_128, AES_256, + StreamingDecryptingKey, StreamingEncryptingKey, UnboundCipherKey, AES_128, AES_192, + AES_256, }, fips::{assert_fips_status_indicator, FipsServiceStatus}, }; @@ -15,6 +16,11 @@ const TEST_KEY_128_BIT: [u8; 16] = [ 0x9f, 0xd9, 0x41, 0xc3, 0xa6, 0xfe, 0xb9, 0x26, 0x2a, 0x35, 0xa7, 0x44, 0xbb, 0xc0, 0x3a, 0x6a, ]; +const TEST_KEY_192_BIT: [u8; 24] = [ + 0x50, 0x2a, 0x6a, 0xb3, 0x69, 0x84, 0xaf, 0x26, 0x8b, 0xf4, 0x23, 0xc7, 0xf5, 0x09, 0x20, 0x52, + 0x07, 0xfc, 0x15, 0x52, 0xaf, 0x4a, 0x91, 0xe5, +]; + const TEST_KEY_256_BIT: [u8; 32] = [ 0xd8, 0x32, 0x58, 0xa9, 0x5a, 0x62, 0x6c, 0x99, 0xc4, 0xe6, 0xb5, 0x3f, 0x97, 0x90, 0x62, 0xbe, 0x71, 0x0f, 0xd5, 0xe1, 0xd4, 0xfe, 0x95, 0xb3, 0x03, 0x46, 0xa5, 0x8e, 0x36, 0xad, 0x18, 0xe3, @@ -107,6 +113,22 @@ streaming_api!( &TEST_KEY_128_BIT ); +streaming_api!( + streaming_aes_192_cbc_pkcs7, + &AES_192, + StreamingEncryptingKey::cbc_pkcs7, + StreamingDecryptingKey::cbc_pkcs7, + &TEST_KEY_192_BIT +); + +streaming_api!( + streaming_aes_192_ctr, + &AES_192, + StreamingEncryptingKey::ctr, + StreamingDecryptingKey::ctr, + &TEST_KEY_192_BIT +); + streaming_api!( streaming_aes_256_cbc_pkcs7, &AES_256, @@ -138,6 +160,22 @@ block_api!( &TEST_KEY_128_BIT ); +block_api!( + block_aes_192_cbc_pkcs7, + &AES_192, + PaddedBlockEncryptingKey::cbc_pkcs7, + PaddedBlockDecryptingKey::cbc_pkcs7, + &TEST_KEY_192_BIT +); + +block_api!( + block_aes_192_ctr, + &AES_192, + EncryptingKey::ctr, + DecryptingKey::ctr, + &TEST_KEY_192_BIT +); + block_api!( block_aes_256_cbc_pkcs7, &AES_256, From ef727c362942db6a44d987062583c134b8595315 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Fri, 6 Dec 2024 13:12:07 -0500 Subject: [PATCH 7/7] PR feedback --- aws-lc-rs/src/cipher.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/aws-lc-rs/src/cipher.rs b/aws-lc-rs/src/cipher.rs index 938161dac7c..403d7537c41 100644 --- a/aws-lc-rs/src/cipher.rs +++ b/aws-lc-rs/src/cipher.rs @@ -355,14 +355,13 @@ define_cipher_context!(DecryptionContext, EncryptionContext); /// Cipher algorithm identifier. pub enum AlgorithmId { /// AES 128-bit - Aes128 = 0, - - // Discriminant explicitly set due to changing implicit discriminant would break semver - /// AES 192-bit - Aes192 = 2, + Aes128, /// AES 256-bit - Aes256 = 1, + Aes256, + + /// AES 192-bit + Aes192, } /// A cipher algorithm.