diff --git a/.github/workflows/belt-dwp.yml b/.github/workflows/belt-dwp.yml index 1c43e249..7f5a17f5 100644 --- a/.github/workflows/belt-dwp.yml +++ b/.github/workflows/belt-dwp.yml @@ -78,5 +78,4 @@ jobs: - run: ${{ matrix.deps }} - run: cargo test --target ${{ matrix.target }} --release --no-default-features --lib - run: cargo test --target ${{ matrix.target }} --release - - run: cargo test --target ${{ matrix.target }} --release --features heapless - run: cargo test --target ${{ matrix.target }} --release --all-features diff --git a/Cargo.lock b/Cargo.lock index 5c4f9882..9830ebef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,14 +6,12 @@ version = 4 [[package]] name = "aead" version = "0.6.0-rc.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8202ab55fcbf46ca829833f347a82a2a4ce0596f0304ac322c2d100030cd56" +source = "git+https://github.com/RustCrypto/traits.git#aae99a0014abd27bf73a31b2c810ffe0b86989bb" dependencies = [ "arrayvec", "blobby", "bytes", "crypto-common", - "heapless", "inout", ] @@ -145,8 +143,9 @@ checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "blobby" -version = "0.4.0-pre.0" -source = "git+https://github.com/RustCrypto/utils#a7e36d36cfc6ae0d804605b91731c7359eb43a95" +version = "0.4.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4db6eec520c1f3d3b060c5b67527c3d1d4122d9f0ff47edf0149a7ffa34cebb" [[package]] name = "block-buffer" @@ -158,12 +157,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "bytes" version = "1.10.1" @@ -246,8 +239,7 @@ dependencies = [ [[package]] name = "crypto-common" version = "0.2.0-rc.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8235645834fbc6832939736ce2f2d08192652269e11010a6240f61b908a1c6" +source = "git+https://github.com/RustCrypto/traits.git#aae99a0014abd27bf73a31b2c810ffe0b86989bb" dependencies = [ "hybrid-array", "rand_core", @@ -326,25 +318,6 @@ dependencies = [ "polyval", ] -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32", - "stable_deref_trait", -] - [[package]] name = "hex-literal" version = "0.4.1" @@ -462,12 +435,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "subtle" version = "2.6.1" diff --git a/Cargo.toml b/Cargo.toml index 544febda..382379e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,5 +19,6 @@ members = [ aead-stream = { path = "aead-stream" } aes-gcm = { path = "aes-gcm" } -# https://github.com/RustCrypto/utils/pull/1187 -blobby = { git = "https://github.com/RustCrypto/utils" } +# https://github.com/RustCrypto/traits/pull/2019 +aead = { git = "https://github.com/RustCrypto/traits.git" } +crypto-common = { git = "https://github.com/RustCrypto/traits.git" } diff --git a/aes-gcm-siv/Cargo.toml b/aes-gcm-siv/Cargo.toml index a5a873bd..9645a828 100644 --- a/aes-gcm-siv/Cargo.toml +++ b/aes-gcm-siv/Cargo.toml @@ -34,7 +34,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] [package.metadata.docs.rs] diff --git a/aes-gcm-siv/src/lib.rs b/aes-gcm-siv/src/lib.rs index 070f8e5d..d183642f 100644 --- a/aes-gcm-siv/src/lib.rs +++ b/aes-gcm-siv/src/lib.rs @@ -38,17 +38,20 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will +//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the +//! [`aead`] crate as [`aead::bytes::BytesMut`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! -#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] -#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] +#![cfg_attr(all(feature = "os_rng", feature = "arrayvec"), doc = "```")] +#![cfg_attr(not(all(feature = "os_rng", feature = "arrayvec")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use aes_gcm_siv::{ -//! aead::{AeadInOut, KeyInit, rand_core::OsRng, heapless::Vec}, +//! aead::{AeadInOut, Buffer, KeyInit, rand_core::OsRng, arrayvec::ArrayVec}, //! Aes256GcmSiv, Nonce, // Or `Aes128GcmSiv` //! }; //! @@ -56,27 +59,21 @@ //! let cipher = Aes256GcmSiv::new(&key); //! let nonce = Nonce::from_slice(b"unique nonce"); // 96-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); // Note: buffer needs 16-bytes overhead for auth tag +//! let mut buffer: ArrayVec = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag //! buffer.extend_from_slice(b"plaintext message"); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(nonce, b"", &mut buffer)?; //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(nonce, b"", &mut buffer)?; -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # Ok(()) //! # } //! ``` -//! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will -//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the -//! [`aead`] crate as [`aead::bytes::BytesMut`]). pub use aead::{self, AeadCore, AeadInOut, Error, Key, KeyInit, KeySizeUser}; diff --git a/aes-gcm-siv/tests/aes128gcmsiv.rs b/aes-gcm-siv/tests/aes128gcmsiv.rs index 9d8ddc17..180f71f9 100644 --- a/aes-gcm-siv/tests/aes128gcmsiv.rs +++ b/aes-gcm-siv/tests/aes128gcmsiv.rs @@ -185,4 +185,5 @@ const TEST_VECTORS: &[TestVector<[u8; 16]>] = &[ tests!(Aes128GcmSiv, TEST_VECTORS); // Test vectors from Wycheproof -aead::new_test!(wycheproof, "wycheproof-128", Aes128GcmSiv); +aead::new_pass_test!(wycheproof_pass, "wycheproof-128_pass", Aes128GcmSiv); +aead::new_fail_test!(wycheproof_fail, "wycheproof-128_fail", Aes128GcmSiv); diff --git a/aes-gcm-siv/tests/aes256gcmsiv.rs b/aes-gcm-siv/tests/aes256gcmsiv.rs index d4ca791e..58719d65 100644 --- a/aes-gcm-siv/tests/aes256gcmsiv.rs +++ b/aes-gcm-siv/tests/aes256gcmsiv.rs @@ -185,4 +185,5 @@ const TEST_VECTORS: &[TestVector<[u8; 32]>] = &[ tests!(Aes256GcmSiv, TEST_VECTORS); // Test vectors from Wycheproof -aead::new_test!(wycheproof, "wycheproof-256", Aes256GcmSiv); +aead::new_pass_test!(wycheproof_pass, "wycheproof-256_pass", Aes256GcmSiv); +aead::new_fail_test!(wycheproof_fail, "wycheproof-256_fail", Aes256GcmSiv); diff --git a/aes-gcm-siv/tests/data/wycheproof-128.blb b/aes-gcm-siv/tests/data/wycheproof-128.blb deleted file mode 100644 index ef8716fb..00000000 Binary files a/aes-gcm-siv/tests/data/wycheproof-128.blb and /dev/null differ diff --git a/aes-gcm-siv/tests/data/wycheproof-128_fail.blb b/aes-gcm-siv/tests/data/wycheproof-128_fail.blb new file mode 100644 index 00000000..265742f0 Binary files /dev/null and b/aes-gcm-siv/tests/data/wycheproof-128_fail.blb differ diff --git a/aes-gcm-siv/tests/data/wycheproof-128_pass.blb b/aes-gcm-siv/tests/data/wycheproof-128_pass.blb new file mode 100644 index 00000000..92508b86 Binary files /dev/null and b/aes-gcm-siv/tests/data/wycheproof-128_pass.blb differ diff --git a/aes-gcm-siv/tests/data/wycheproof-256.blb b/aes-gcm-siv/tests/data/wycheproof-256.blb deleted file mode 100644 index f3642a48..00000000 Binary files a/aes-gcm-siv/tests/data/wycheproof-256.blb and /dev/null differ diff --git a/aes-gcm-siv/tests/data/wycheproof-256_fail.blb b/aes-gcm-siv/tests/data/wycheproof-256_fail.blb new file mode 100644 index 00000000..1ca0b0ca Binary files /dev/null and b/aes-gcm-siv/tests/data/wycheproof-256_fail.blb differ diff --git a/aes-gcm-siv/tests/data/wycheproof-256_pass.blb b/aes-gcm-siv/tests/data/wycheproof-256_pass.blb new file mode 100644 index 00000000..11d19ded Binary files /dev/null and b/aes-gcm-siv/tests/data/wycheproof-256_pass.blb differ diff --git a/aes-gcm/Cargo.toml b/aes-gcm/Cargo.toml index fe75c3aa..48967dfb 100644 --- a/aes-gcm/Cargo.toml +++ b/aes-gcm/Cargo.toml @@ -35,7 +35,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] [package.metadata.docs.rs] diff --git a/aes-gcm/src/lib.rs b/aes-gcm/src/lib.rs index 90d41b64..def1bf4c 100644 --- a/aes-gcm/src/lib.rs +++ b/aes-gcm/src/lib.rs @@ -12,8 +12,8 @@ //! //! Simple usage (allocating, no associated data): //! -#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] -#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] +#![cfg_attr(feature = "os_rng", doc = "```")] +#![cfg_attr(not(feature = "os_rng"), doc = "```ignore")] //! use aes_gcm::{ //! aead::{Aead, AeadCore, KeyInit, rand_core::OsRng}, //! Aes256Gcm, Nonce, Key // Or `Aes128Gcm` @@ -58,17 +58,20 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will +//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the +//! [`aead`] crate as [`aead::bytes::BytesMut`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! -#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] -#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] +#![cfg_attr(all(feature = "os_rng", feature = "arrayvec"), doc = "```")] +#![cfg_attr(not(all(feature = "os_rng", feature = "arrayvec")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use aes_gcm::{ -//! aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, heapless::Vec}, +//! aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, arrayvec::ArrayVec}, //! Aes256Gcm, Nonce, // Or `Aes128Gcm` //! }; //! @@ -76,27 +79,20 @@ //! let cipher = Aes256Gcm::new(&key); //! let nonce = Aes256Gcm::generate_nonce().expect("generate nonce"); // 96-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); // Note: buffer needs 16-bytes overhead for auth tag -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(&nonce, b"", &mut buffer)?; //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(&nonce, b"", &mut buffer)?; -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # Ok(()) //! # } -//! ``` -//! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will -//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the -//! [`aead`] crate as [`aead::bytes::BytesMut`]). pub use aead::{self, AeadCore, AeadInOut, Error, Key, KeyInit, KeySizeUser}; diff --git a/aes-gcm/tests/aes128gcm.rs b/aes-gcm/tests/aes128gcm.rs index 819a631b..475f2f2b 100644 --- a/aes-gcm/tests/aes128gcm.rs +++ b/aes-gcm/tests/aes128gcm.rs @@ -3621,4 +3621,5 @@ const TEST_VECTORS: &[TestVector<[u8; 16], [u8; 12]>] = &[ tests!(Aes128Gcm, TEST_VECTORS); // Test vectors from Wycheproof -aead::new_test!(wycheproof, "wycheproof-128", Aes128Gcm); +aead::new_pass_test!(wycheproof_pass, "wycheproof-128_pass", Aes128Gcm); +aead::new_fail_test!(wycheproof_fail, "wycheproof-128_fail", Aes128Gcm); diff --git a/aes-gcm/tests/aes256gcm.rs b/aes-gcm/tests/aes256gcm.rs index 7f0ea0b5..b9910d32 100644 --- a/aes-gcm/tests/aes256gcm.rs +++ b/aes-gcm/tests/aes256gcm.rs @@ -3621,4 +3621,5 @@ const TEST_VECTORS: &[TestVector<[u8; 32], [u8; 12]>] = &[ tests!(Aes256Gcm, TEST_VECTORS); // Test vectors from Wycheproof -aead::new_test!(wycheproof, "wycheproof-256", Aes256Gcm); +aead::new_pass_test!(wycheproof_pass, "wycheproof-256_pass", Aes256Gcm); +aead::new_fail_test!(wycheproof_fail, "wycheproof-256_fail", Aes256Gcm); diff --git a/aes-gcm/tests/data/wycheproof-128.blb b/aes-gcm/tests/data/wycheproof-128.blb deleted file mode 100644 index 439c0c5f..00000000 Binary files a/aes-gcm/tests/data/wycheproof-128.blb and /dev/null differ diff --git a/aes-gcm/tests/data/wycheproof-128_fail.blb b/aes-gcm/tests/data/wycheproof-128_fail.blb new file mode 100644 index 00000000..31a8013c Binary files /dev/null and b/aes-gcm/tests/data/wycheproof-128_fail.blb differ diff --git a/aes-gcm/tests/data/wycheproof-128_pass.blb b/aes-gcm/tests/data/wycheproof-128_pass.blb new file mode 100644 index 00000000..854c459b Binary files /dev/null and b/aes-gcm/tests/data/wycheproof-128_pass.blb differ diff --git a/aes-gcm/tests/data/wycheproof-256.blb b/aes-gcm/tests/data/wycheproof-256.blb deleted file mode 100644 index 629d65bb..00000000 Binary files a/aes-gcm/tests/data/wycheproof-256.blb and /dev/null differ diff --git a/aes-gcm/tests/data/wycheproof-256_fail.blb b/aes-gcm/tests/data/wycheproof-256_fail.blb new file mode 100644 index 00000000..ed43e2cc Binary files /dev/null and b/aes-gcm/tests/data/wycheproof-256_fail.blb differ diff --git a/aes-gcm/tests/data/wycheproof-256_pass.blb b/aes-gcm/tests/data/wycheproof-256_pass.blb new file mode 100644 index 00000000..50703107 Binary files /dev/null and b/aes-gcm/tests/data/wycheproof-256_pass.blb differ diff --git a/aes-siv/Cargo.toml b/aes-siv/Cargo.toml index 83bc2169..0f196759 100644 --- a/aes-siv/Cargo.toml +++ b/aes-siv/Cargo.toml @@ -40,7 +40,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] [package.metadata.docs.rs] diff --git a/aes-siv/src/lib.rs b/aes-siv/src/lib.rs index dc05de90..391532dd 100644 --- a/aes-siv/src/lib.rs +++ b/aes-siv/src/lib.rs @@ -38,17 +38,20 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will +//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the +//! [`aead`] crate as [`aead::bytes::BytesMut`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! -#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] -#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] +#![cfg_attr(all(feature = "os_rng", feature = "arrayvec"), doc = "```")] +#![cfg_attr(not(all(feature = "os_rng", feature = "arrayvec")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use aes_siv::{ -//! aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, heapless::Vec}, +//! aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, arrayvec::ArrayVec}, //! Aes256SivAead, Nonce, // Or `Aes128SivAead` //! }; //! @@ -56,27 +59,21 @@ //! let cipher = Aes256SivAead::new(&key); //! let nonce = Aes256SivAead::generate_nonce().expect("Generate nonce"); // 128-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); // Note: buffer needs 16-bytes overhead for auth tag -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(&nonce, b"", &mut buffer)?; //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(&nonce, b"", &mut buffer)?; -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # Ok(()) //! # } //! ``` -//! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will -//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the -//! [`aead`] crate as [`aead::bytes::BytesMut`]). #[cfg(feature = "alloc")] extern crate alloc; diff --git a/aes-siv/tests/data/wycheproof-256.blb b/aes-siv/tests/data/wycheproof-256.blb deleted file mode 100644 index 1e31f077..00000000 Binary files a/aes-siv/tests/data/wycheproof-256.blb and /dev/null differ diff --git a/aes-siv/tests/data/wycheproof-256_fail.blb b/aes-siv/tests/data/wycheproof-256_fail.blb new file mode 100644 index 00000000..cf4d1f34 Binary files /dev/null and b/aes-siv/tests/data/wycheproof-256_fail.blb differ diff --git a/aes-siv/tests/data/wycheproof-256_pass.blb b/aes-siv/tests/data/wycheproof-256_pass.blb new file mode 100644 index 00000000..9fcb1e3d Binary files /dev/null and b/aes-siv/tests/data/wycheproof-256_pass.blb differ diff --git a/aes-siv/tests/data/wycheproof-512.blb b/aes-siv/tests/data/wycheproof-512.blb deleted file mode 100644 index d4ca3b1a..00000000 Binary files a/aes-siv/tests/data/wycheproof-512.blb and /dev/null differ diff --git a/aes-siv/tests/data/wycheproof-512_fail.blb b/aes-siv/tests/data/wycheproof-512_fail.blb new file mode 100644 index 00000000..7ae8ce1a Binary files /dev/null and b/aes-siv/tests/data/wycheproof-512_fail.blb differ diff --git a/aes-siv/tests/data/wycheproof-512_pass.blb b/aes-siv/tests/data/wycheproof-512_pass.blb new file mode 100644 index 00000000..6debeb73 Binary files /dev/null and b/aes-siv/tests/data/wycheproof-512_pass.blb differ diff --git a/aes-siv/tests/siv.rs b/aes-siv/tests/siv.rs index e06c7b4f..43777580 100644 --- a/aes-siv/tests/siv.rs +++ b/aes-siv/tests/siv.rs @@ -50,7 +50,7 @@ macro_rules! tests { } macro_rules! wycheproof_tests { - ($siv:ty, $name:ident, $test_name:expr) => { + ($siv:ty, $name:ident, $test_name:expr, pass = $pass:expr) => { #[test] fn $name() { use aead::dev::TestVector; @@ -58,7 +58,7 @@ macro_rules! wycheproof_tests { aead::dev::blobby::parse_into_structs!( include_bytes!(concat!("data/", $test_name, ".blb")); static TEST_VECTORS: &[ - TestVector { key, nonce, aad, plaintext, ciphertext, pass } + TestVector { key, nonce, aad, plaintext, ciphertext } ]; ); @@ -93,13 +93,8 @@ macro_rules! wycheproof_tests { } for (i, row) in TEST_VECTORS.iter().enumerate() { - let &TestVector{ key, aad, plaintext: pt, ciphertext: ct, pass, ..} = row; - let pass = match pass[0] { - 0 => false, - 1 => true, - _ => panic!("invalid value for pass flag"), - }; - if let Some(desc) = run_test(key, aad, pt, ct, pass) { + let &TestVector{ key, aad, plaintext: pt, ciphertext: ct, ..} = row; + if let Some(desc) = run_test(key, aad, pt, ct, $pass) { panic!( "\n\ Failed test №{}: {}\n\ @@ -108,7 +103,7 @@ macro_rules! wycheproof_tests { pt:\t{:?}\n\ ct:\t{:?}\n\ pass:\t{:?}\n", - i, desc, key, aad, pt, ct, pass, + i, desc, key, aad, pt, ct, $pass, ); } } @@ -161,7 +156,18 @@ mod aes128cmacsiv { tests!(Aes128Siv, TEST_VECTORS); - wycheproof_tests!(Aes128Siv, wycheproof, "wycheproof-256"); + wycheproof_tests!( + Aes128Siv, + wycheproof_pass, + "wycheproof-256_pass", + pass = true + ); + wycheproof_tests!( + Aes128Siv, + wycheproof_fail, + "wycheproof-256_fail", + pass = false + ); } mod aes256cmacsiv { @@ -201,7 +207,18 @@ mod aes256cmacsiv { tests!(Aes256Siv, TEST_VECTORS); - wycheproof_tests!(Aes256Siv, wycheproof, "wycheproof-512"); + wycheproof_tests!( + Aes256Siv, + wycheproof_pass, + "wycheproof-512_pass", + pass = true + ); + wycheproof_tests!( + Aes256Siv, + wycheproof_fail, + "wycheproof-512_fail", + pass = false + ); } #[cfg(feature = "pmac")] diff --git a/ascon-aead128/Cargo.toml b/ascon-aead128/Cargo.toml index 3fe2e48d..fe3762ff 100644 --- a/ascon-aead128/Cargo.toml +++ b/ascon-aead128/Cargo.toml @@ -26,7 +26,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] zeroize = ["dep:zeroize", "ascon/zeroize"] diff --git a/ascon-aead128/src/lib.rs b/ascon-aead128/src/lib.rs index 3cff18ac..62ab84e5 100644 --- a/ascon-aead128/src/lib.rs +++ b/ascon-aead128/src/lib.rs @@ -62,43 +62,40 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will +//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the +//! [`aead`] crate as [`aead::bytes::BytesMut`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! //! ``` -//! # #[cfg(feature = "heapless")] { +//! # #[cfg(feature = "arrayvec")] { //! use ascon_aead128::{AsconAead128, Key, Nonce}; //! use ascon_aead128::aead::{AeadInOut, KeyInit}; -//! use ascon_aead128::aead::heapless::Vec; +//! use ascon_aead128::aead::arrayvec::ArrayVec; //! //! let key = Key::::from_slice(b"very secret key."); //! let cipher = AsconAead128::new(key); //! //! let nonce = Nonce::::from_slice(b"unique nonce 012"); // 128-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); // Buffer needs 16-bytes overhead for authentication tag -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); // Buffer needs 16-bytes overhead for authentication tag +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(nonce, b"", &mut buffer).expect("encryption failure!"); //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(nonce, b"", &mut buffer).expect("decryption failure!"); -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # } //! ``` -//! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will -//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the -//! [`aead`] crate as [`aead::bytes::BytesMut`]). #[cfg(feature = "zeroize")] pub use zeroize; diff --git a/ascon-aead128/tests/data/reference_kats.blb b/ascon-aead128/tests/data/reference_kats.blb deleted file mode 100644 index 15b3c4f0..00000000 Binary files a/ascon-aead128/tests/data/reference_kats.blb and /dev/null differ diff --git a/ascon-aead128/tests/data/reference_kats_fail.blb b/ascon-aead128/tests/data/reference_kats_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ascon-aead128/tests/data/reference_kats_fail.blb differ diff --git a/ascon-aead128/tests/data/reference_kats_pass.blb b/ascon-aead128/tests/data/reference_kats_pass.blb new file mode 100644 index 00000000..f026fafd Binary files /dev/null and b/ascon-aead128/tests/data/reference_kats_pass.blb differ diff --git a/ascon-aead128/tests/reference_kats.rs b/ascon-aead128/tests/reference_kats.rs index 82c6c73e..3e72a6bf 100644 --- a/ascon-aead128/tests/reference_kats.rs +++ b/ascon-aead128/tests/reference_kats.rs @@ -2,4 +2,13 @@ use ascon_aead128::AsconAead128; // Test vectors are taken from the reference Ascon implementation: // https://github.com/ascon/ascon-c/blob/fdfca408/crypto_aead/asconaead128/LWC_AEAD_KAT_128_128.txt -aead::new_test!(ascon_aead_reference_kats, "reference_kats", AsconAead128); +aead::new_pass_test!( + ascon_aead_reference_kats_pass, + "reference_kats_pass", + AsconAead128 +); +aead::new_fail_test!( + ascon_aead_reference_kats_fail, + "reference_kats_fail", + AsconAead128 +); diff --git a/belt-dwp/Cargo.toml b/belt-dwp/Cargo.toml index 1ef128e3..c3016ec9 100644 --- a/belt-dwp/Cargo.toml +++ b/belt-dwp/Cargo.toml @@ -29,7 +29,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] reduced-round = [] zeroize = ["dep:zeroize", "belt-ctr/zeroize"] diff --git a/belt-dwp/src/lib.rs b/belt-dwp/src/lib.rs index 0f404115..899263e6 100644 --- a/belt-dwp/src/lib.rs +++ b/belt-dwp/src/lib.rs @@ -13,7 +13,7 @@ //! //! ``` //! # fn main() -> Result<(), Box> { -//! # #[cfg(all(feature = "os_rng", feature = "heapless"))] { +//! # #[cfg(feature = "os_rng")] { //! use belt_dwp::{ //! aead::{Aead, AeadCore, KeyInit}, Nonce, BeltDwp //! }; @@ -36,17 +36,18 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! //! ``` //! # fn main() -> Result<(), Box> { -//! # #[cfg(all(feature = "os_rng", feature = "heapless"))] { +//! # #[cfg(all(feature = "os_rng", feature = "arrayvec"))] { //! use belt_dwp::{ -//! aead::{AeadInOut, KeyInit, heapless::Vec}, +//! aead::{AeadInOut, KeyInit, arrayvec::ArrayVec}, //! Nonce, BeltDwp //! }; //! @@ -54,24 +55,20 @@ //! let cipher = BeltDwp::new(&key); //! let nonce = Nonce::try_from(&b"unique nonce1234"[..]).unwrap(); // 128-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); // Note: buffer needs 16-bytes overhead for auth tag -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(&nonce, b"", &mut buffer)?; //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(&nonce, b"", &mut buffer)?; -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # }; Ok(()) } //! ``` -//! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]). pub use aead::{self, AeadCore, AeadInOut, Error, Key, KeyInit, KeySizeUser, Tag}; pub use belt_block::BeltBlock; diff --git a/ccm/Cargo.toml b/ccm/Cargo.toml index 21f71c31..ebe9a796 100644 --- a/ccm/Cargo.toml +++ b/ccm/Cargo.toml @@ -30,5 +30,4 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] diff --git a/ccm/tests/data/cavp_ccm_aes128_10_13.blb b/ccm/tests/data/cavp_ccm_aes128_10_13.blb deleted file mode 100644 index e5fe5b58..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_10_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_10_13_fail.blb b/ccm/tests/data/cavp_ccm_aes128_10_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_10_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_10_13_pass.blb b/ccm/tests/data/cavp_ccm_aes128_10_13_pass.blb new file mode 100644 index 00000000..f48a9a0a Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_10_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_12_13.blb b/ccm/tests/data/cavp_ccm_aes128_12_13.blb deleted file mode 100644 index a20575a2..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_12_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_12_13_fail.blb b/ccm/tests/data/cavp_ccm_aes128_12_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_12_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_12_13_pass.blb b/ccm/tests/data/cavp_ccm_aes128_12_13_pass.blb new file mode 100644 index 00000000..5fb6a0f9 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_12_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_14_13.blb b/ccm/tests/data/cavp_ccm_aes128_14_13.blb deleted file mode 100644 index 53782044..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_14_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_14_13_fail.blb b/ccm/tests/data/cavp_ccm_aes128_14_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_14_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_14_13_pass.blb b/ccm/tests/data/cavp_ccm_aes128_14_13_pass.blb new file mode 100644 index 00000000..ce0ea521 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_14_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_10.blb b/ccm/tests/data/cavp_ccm_aes128_16_10.blb deleted file mode 100644 index 3bebc5b0..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_16_10.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_10_fail.blb b/ccm/tests/data/cavp_ccm_aes128_16_10_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_10_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_10_pass.blb b/ccm/tests/data/cavp_ccm_aes128_16_10_pass.blb new file mode 100644 index 00000000..1e8ebd87 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_10_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_11.blb b/ccm/tests/data/cavp_ccm_aes128_16_11.blb deleted file mode 100644 index 1c59b1d4..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_16_11.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_11_fail.blb b/ccm/tests/data/cavp_ccm_aes128_16_11_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_11_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_11_pass.blb b/ccm/tests/data/cavp_ccm_aes128_16_11_pass.blb new file mode 100644 index 00000000..81cebe2a Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_11_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_12.blb b/ccm/tests/data/cavp_ccm_aes128_16_12.blb deleted file mode 100644 index 59d29c9c..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_16_12.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_12_fail.blb b/ccm/tests/data/cavp_ccm_aes128_16_12_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_12_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_12_pass.blb b/ccm/tests/data/cavp_ccm_aes128_16_12_pass.blb new file mode 100644 index 00000000..23d67160 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_12_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_13.blb b/ccm/tests/data/cavp_ccm_aes128_16_13.blb deleted file mode 100644 index afe87369..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_16_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_13_fail.blb b/ccm/tests/data/cavp_ccm_aes128_16_13_fail.blb new file mode 100644 index 00000000..db979ae5 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_13_pass.blb b/ccm/tests/data/cavp_ccm_aes128_16_13_pass.blb new file mode 100644 index 00000000..9521ebf4 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_7.blb b/ccm/tests/data/cavp_ccm_aes128_16_7.blb deleted file mode 100644 index 2ea0bfe7..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_16_7.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_7_fail.blb b/ccm/tests/data/cavp_ccm_aes128_16_7_fail.blb new file mode 100644 index 00000000..d4b0bab5 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_7_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_7_pass.blb b/ccm/tests/data/cavp_ccm_aes128_16_7_pass.blb new file mode 100644 index 00000000..eb903a1c Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_7_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_8.blb b/ccm/tests/data/cavp_ccm_aes128_16_8.blb deleted file mode 100644 index 51b05568..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_16_8.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_8_fail.blb b/ccm/tests/data/cavp_ccm_aes128_16_8_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_8_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_8_pass.blb b/ccm/tests/data/cavp_ccm_aes128_16_8_pass.blb new file mode 100644 index 00000000..ab5ce467 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_8_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_9.blb b/ccm/tests/data/cavp_ccm_aes128_16_9.blb deleted file mode 100644 index e6d27f12..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_16_9.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_9_fail.blb b/ccm/tests/data/cavp_ccm_aes128_16_9_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_9_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_16_9_pass.blb b/ccm/tests/data/cavp_ccm_aes128_16_9_pass.blb new file mode 100644 index 00000000..ffff96e2 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_16_9_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_4_13.blb b/ccm/tests/data/cavp_ccm_aes128_4_13.blb deleted file mode 100644 index 02142310..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_4_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_4_13_fail.blb b/ccm/tests/data/cavp_ccm_aes128_4_13_fail.blb new file mode 100644 index 00000000..34c61d90 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_4_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_4_13_pass.blb b/ccm/tests/data/cavp_ccm_aes128_4_13_pass.blb new file mode 100644 index 00000000..9a8fb553 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_4_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_4_7.blb b/ccm/tests/data/cavp_ccm_aes128_4_7.blb deleted file mode 100644 index e79768d2..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_4_7.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_4_7_fail.blb b/ccm/tests/data/cavp_ccm_aes128_4_7_fail.blb new file mode 100644 index 00000000..493d8dc9 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_4_7_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_4_7_pass.blb b/ccm/tests/data/cavp_ccm_aes128_4_7_pass.blb new file mode 100644 index 00000000..36b62e81 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_4_7_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_6_13.blb b/ccm/tests/data/cavp_ccm_aes128_6_13.blb deleted file mode 100644 index 8f5c235b..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_6_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_6_13_fail.blb b/ccm/tests/data/cavp_ccm_aes128_6_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_6_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_6_13_pass.blb b/ccm/tests/data/cavp_ccm_aes128_6_13_pass.blb new file mode 100644 index 00000000..50481517 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_6_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_8_13.blb b/ccm/tests/data/cavp_ccm_aes128_8_13.blb deleted file mode 100644 index ad474ce5..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes128_8_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes128_8_13_fail.blb b/ccm/tests/data/cavp_ccm_aes128_8_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_8_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes128_8_13_pass.blb b/ccm/tests/data/cavp_ccm_aes128_8_13_pass.blb new file mode 100644 index 00000000..445dabe3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes128_8_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_10_13.blb b/ccm/tests/data/cavp_ccm_aes192_10_13.blb deleted file mode 100644 index fab58512..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_10_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_10_13_fail.blb b/ccm/tests/data/cavp_ccm_aes192_10_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_10_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_10_13_pass.blb b/ccm/tests/data/cavp_ccm_aes192_10_13_pass.blb new file mode 100644 index 00000000..bda3b892 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_10_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_12_13.blb b/ccm/tests/data/cavp_ccm_aes192_12_13.blb deleted file mode 100644 index c5dd1735..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_12_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_12_13_fail.blb b/ccm/tests/data/cavp_ccm_aes192_12_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_12_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_12_13_pass.blb b/ccm/tests/data/cavp_ccm_aes192_12_13_pass.blb new file mode 100644 index 00000000..f85f0a2b Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_12_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_14_13.blb b/ccm/tests/data/cavp_ccm_aes192_14_13.blb deleted file mode 100644 index 38a968d1..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_14_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_14_13_fail.blb b/ccm/tests/data/cavp_ccm_aes192_14_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_14_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_14_13_pass.blb b/ccm/tests/data/cavp_ccm_aes192_14_13_pass.blb new file mode 100644 index 00000000..ac609108 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_14_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_10.blb b/ccm/tests/data/cavp_ccm_aes192_16_10.blb deleted file mode 100644 index e8d1ce12..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_16_10.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_10_fail.blb b/ccm/tests/data/cavp_ccm_aes192_16_10_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_10_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_10_pass.blb b/ccm/tests/data/cavp_ccm_aes192_16_10_pass.blb new file mode 100644 index 00000000..2717ec6a Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_10_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_11.blb b/ccm/tests/data/cavp_ccm_aes192_16_11.blb deleted file mode 100644 index 4ff17e45..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_16_11.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_11_fail.blb b/ccm/tests/data/cavp_ccm_aes192_16_11_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_11_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_11_pass.blb b/ccm/tests/data/cavp_ccm_aes192_16_11_pass.blb new file mode 100644 index 00000000..d78eb773 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_11_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_12.blb b/ccm/tests/data/cavp_ccm_aes192_16_12.blb deleted file mode 100644 index 11980952..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_16_12.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_12_fail.blb b/ccm/tests/data/cavp_ccm_aes192_16_12_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_12_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_12_pass.blb b/ccm/tests/data/cavp_ccm_aes192_16_12_pass.blb new file mode 100644 index 00000000..9ade00d5 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_12_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_13.blb b/ccm/tests/data/cavp_ccm_aes192_16_13.blb deleted file mode 100644 index 9f95fdce..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_16_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_13_fail.blb b/ccm/tests/data/cavp_ccm_aes192_16_13_fail.blb new file mode 100644 index 00000000..b2fc5f54 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_13_pass.blb b/ccm/tests/data/cavp_ccm_aes192_16_13_pass.blb new file mode 100644 index 00000000..d80c7db6 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_7.blb b/ccm/tests/data/cavp_ccm_aes192_16_7.blb deleted file mode 100644 index 6f1764b5..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_16_7.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_7_fail.blb b/ccm/tests/data/cavp_ccm_aes192_16_7_fail.blb new file mode 100644 index 00000000..09f917f1 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_7_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_7_pass.blb b/ccm/tests/data/cavp_ccm_aes192_16_7_pass.blb new file mode 100644 index 00000000..6c362dd3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_7_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_8.blb b/ccm/tests/data/cavp_ccm_aes192_16_8.blb deleted file mode 100644 index 9df598f8..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_16_8.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_8_fail.blb b/ccm/tests/data/cavp_ccm_aes192_16_8_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_8_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_8_pass.blb b/ccm/tests/data/cavp_ccm_aes192_16_8_pass.blb new file mode 100644 index 00000000..de899885 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_8_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_9.blb b/ccm/tests/data/cavp_ccm_aes192_16_9.blb deleted file mode 100644 index c78d002f..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_16_9.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_9_fail.blb b/ccm/tests/data/cavp_ccm_aes192_16_9_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_9_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_16_9_pass.blb b/ccm/tests/data/cavp_ccm_aes192_16_9_pass.blb new file mode 100644 index 00000000..7400d182 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_16_9_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_4_13.blb b/ccm/tests/data/cavp_ccm_aes192_4_13.blb deleted file mode 100644 index 501a7de2..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_4_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_4_13_fail.blb b/ccm/tests/data/cavp_ccm_aes192_4_13_fail.blb new file mode 100644 index 00000000..b9aaeea7 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_4_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_4_13_pass.blb b/ccm/tests/data/cavp_ccm_aes192_4_13_pass.blb new file mode 100644 index 00000000..1b858184 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_4_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_4_7.blb b/ccm/tests/data/cavp_ccm_aes192_4_7.blb deleted file mode 100644 index 3b14a62c..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_4_7.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_4_7_fail.blb b/ccm/tests/data/cavp_ccm_aes192_4_7_fail.blb new file mode 100644 index 00000000..74b43eae Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_4_7_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_4_7_pass.blb b/ccm/tests/data/cavp_ccm_aes192_4_7_pass.blb new file mode 100644 index 00000000..ac71c8ba Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_4_7_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_6_13.blb b/ccm/tests/data/cavp_ccm_aes192_6_13.blb deleted file mode 100644 index 32f06374..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_6_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_6_13_fail.blb b/ccm/tests/data/cavp_ccm_aes192_6_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_6_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_6_13_pass.blb b/ccm/tests/data/cavp_ccm_aes192_6_13_pass.blb new file mode 100644 index 00000000..b546fbfa Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_6_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_8_13.blb b/ccm/tests/data/cavp_ccm_aes192_8_13.blb deleted file mode 100644 index a84e2a17..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes192_8_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes192_8_13_fail.blb b/ccm/tests/data/cavp_ccm_aes192_8_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_8_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes192_8_13_pass.blb b/ccm/tests/data/cavp_ccm_aes192_8_13_pass.blb new file mode 100644 index 00000000..762d2c73 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes192_8_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_10_13.blb b/ccm/tests/data/cavp_ccm_aes256_10_13.blb deleted file mode 100644 index def67e6e..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_10_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_10_13_fail.blb b/ccm/tests/data/cavp_ccm_aes256_10_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_10_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_10_13_pass.blb b/ccm/tests/data/cavp_ccm_aes256_10_13_pass.blb new file mode 100644 index 00000000..a979af7e Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_10_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_12_13.blb b/ccm/tests/data/cavp_ccm_aes256_12_13.blb deleted file mode 100644 index 9d92af39..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_12_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_12_13_fail.blb b/ccm/tests/data/cavp_ccm_aes256_12_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_12_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_12_13_pass.blb b/ccm/tests/data/cavp_ccm_aes256_12_13_pass.blb new file mode 100644 index 00000000..e92d5a0c Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_12_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_14_13.blb b/ccm/tests/data/cavp_ccm_aes256_14_13.blb deleted file mode 100644 index 6a32bd60..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_14_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_14_13_fail.blb b/ccm/tests/data/cavp_ccm_aes256_14_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_14_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_14_13_pass.blb b/ccm/tests/data/cavp_ccm_aes256_14_13_pass.blb new file mode 100644 index 00000000..5f4dcba3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_14_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_10.blb b/ccm/tests/data/cavp_ccm_aes256_16_10.blb deleted file mode 100644 index c775a820..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_16_10.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_10_fail.blb b/ccm/tests/data/cavp_ccm_aes256_16_10_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_10_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_10_pass.blb b/ccm/tests/data/cavp_ccm_aes256_16_10_pass.blb new file mode 100644 index 00000000..a3d4ac12 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_10_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_11.blb b/ccm/tests/data/cavp_ccm_aes256_16_11.blb deleted file mode 100644 index e4884f28..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_16_11.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_11_fail.blb b/ccm/tests/data/cavp_ccm_aes256_16_11_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_11_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_11_pass.blb b/ccm/tests/data/cavp_ccm_aes256_16_11_pass.blb new file mode 100644 index 00000000..5a8797af Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_11_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_12.blb b/ccm/tests/data/cavp_ccm_aes256_16_12.blb deleted file mode 100644 index 5f4ccac6..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_16_12.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_12_fail.blb b/ccm/tests/data/cavp_ccm_aes256_16_12_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_12_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_12_pass.blb b/ccm/tests/data/cavp_ccm_aes256_16_12_pass.blb new file mode 100644 index 00000000..e1afec09 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_12_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_13.blb b/ccm/tests/data/cavp_ccm_aes256_16_13.blb deleted file mode 100644 index 6927c265..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_16_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_13_fail.blb b/ccm/tests/data/cavp_ccm_aes256_16_13_fail.blb new file mode 100644 index 00000000..2ece68aa Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_13_pass.blb b/ccm/tests/data/cavp_ccm_aes256_16_13_pass.blb new file mode 100644 index 00000000..940366bb Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_7.blb b/ccm/tests/data/cavp_ccm_aes256_16_7.blb deleted file mode 100644 index 084f79f5..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_16_7.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_7_fail.blb b/ccm/tests/data/cavp_ccm_aes256_16_7_fail.blb new file mode 100644 index 00000000..e0231c0e Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_7_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_7_pass.blb b/ccm/tests/data/cavp_ccm_aes256_16_7_pass.blb new file mode 100644 index 00000000..1d4b0444 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_7_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_8.blb b/ccm/tests/data/cavp_ccm_aes256_16_8.blb deleted file mode 100644 index 6072e14b..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_16_8.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_8_fail.blb b/ccm/tests/data/cavp_ccm_aes256_16_8_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_8_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_8_pass.blb b/ccm/tests/data/cavp_ccm_aes256_16_8_pass.blb new file mode 100644 index 00000000..e1453843 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_8_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_9.blb b/ccm/tests/data/cavp_ccm_aes256_16_9.blb deleted file mode 100644 index 7e81c720..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_16_9.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_9_fail.blb b/ccm/tests/data/cavp_ccm_aes256_16_9_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_9_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_16_9_pass.blb b/ccm/tests/data/cavp_ccm_aes256_16_9_pass.blb new file mode 100644 index 00000000..ec895820 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_16_9_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_4_13.blb b/ccm/tests/data/cavp_ccm_aes256_4_13.blb deleted file mode 100644 index 29cd8260..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_4_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_4_13_fail.blb b/ccm/tests/data/cavp_ccm_aes256_4_13_fail.blb new file mode 100644 index 00000000..3193acd6 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_4_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_4_13_pass.blb b/ccm/tests/data/cavp_ccm_aes256_4_13_pass.blb new file mode 100644 index 00000000..71a04bd1 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_4_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_4_7.blb b/ccm/tests/data/cavp_ccm_aes256_4_7.blb deleted file mode 100644 index e0c26d2e..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_4_7.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_4_7_fail.blb b/ccm/tests/data/cavp_ccm_aes256_4_7_fail.blb new file mode 100644 index 00000000..2dbaa603 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_4_7_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_4_7_pass.blb b/ccm/tests/data/cavp_ccm_aes256_4_7_pass.blb new file mode 100644 index 00000000..af06006e Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_4_7_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_6_13.blb b/ccm/tests/data/cavp_ccm_aes256_6_13.blb deleted file mode 100644 index 6a57be3d..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_6_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_6_13_fail.blb b/ccm/tests/data/cavp_ccm_aes256_6_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_6_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_6_13_pass.blb b/ccm/tests/data/cavp_ccm_aes256_6_13_pass.blb new file mode 100644 index 00000000..98a359ad Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_6_13_pass.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_8_13.blb b/ccm/tests/data/cavp_ccm_aes256_8_13.blb deleted file mode 100644 index f9fe7d12..00000000 Binary files a/ccm/tests/data/cavp_ccm_aes256_8_13.blb and /dev/null differ diff --git a/ccm/tests/data/cavp_ccm_aes256_8_13_fail.blb b/ccm/tests/data/cavp_ccm_aes256_8_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_8_13_fail.blb differ diff --git a/ccm/tests/data/cavp_ccm_aes256_8_13_pass.blb b/ccm/tests/data/cavp_ccm_aes256_8_13_pass.blb new file mode 100644 index 00000000..0f6af727 Binary files /dev/null and b/ccm/tests/data/cavp_ccm_aes256_8_13_pass.blb differ diff --git a/ccm/tests/data/rfc3610_ccm_aes128_10_13.blb b/ccm/tests/data/rfc3610_ccm_aes128_10_13.blb deleted file mode 100644 index ff8e5a5c..00000000 Binary files a/ccm/tests/data/rfc3610_ccm_aes128_10_13.blb and /dev/null differ diff --git a/ccm/tests/data/rfc3610_ccm_aes128_10_13_fail.blb b/ccm/tests/data/rfc3610_ccm_aes128_10_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/rfc3610_ccm_aes128_10_13_fail.blb differ diff --git a/ccm/tests/data/rfc3610_ccm_aes128_10_13_pass.blb b/ccm/tests/data/rfc3610_ccm_aes128_10_13_pass.blb new file mode 100644 index 00000000..aa457568 Binary files /dev/null and b/ccm/tests/data/rfc3610_ccm_aes128_10_13_pass.blb differ diff --git a/ccm/tests/data/rfc3610_ccm_aes128_8_13.blb b/ccm/tests/data/rfc3610_ccm_aes128_8_13.blb deleted file mode 100644 index c60b82d9..00000000 Binary files a/ccm/tests/data/rfc3610_ccm_aes128_8_13.blb and /dev/null differ diff --git a/ccm/tests/data/rfc3610_ccm_aes128_8_13_fail.blb b/ccm/tests/data/rfc3610_ccm_aes128_8_13_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ccm/tests/data/rfc3610_ccm_aes128_8_13_fail.blb differ diff --git a/ccm/tests/data/rfc3610_ccm_aes128_8_13_pass.blb b/ccm/tests/data/rfc3610_ccm_aes128_8_13_pass.blb new file mode 100644 index 00000000..87c166de Binary files /dev/null and b/ccm/tests/data/rfc3610_ccm_aes128_8_13_pass.blb differ diff --git a/ccm/tests/mod.rs b/ccm/tests/mod.rs index f4b20fb8..3288f8b8 100644 --- a/ccm/tests/mod.rs +++ b/ccm/tests/mod.rs @@ -98,52 +98,96 @@ fn sp800_38c_examples() { } // Test vectors from https://tools.ietf.org/html/rfc3610 -aead::new_test!(rfc3610_ccm_aes128_8_13, "rfc3610_ccm_aes128_8_13", Ccm); -aead::new_test!(rfc3610_ccm_aes128_10_13, "rfc3610_ccm_aes128_10_13", Ccm); +aead::new_pass_test!(rfc3610_ccm_aes128_8_13_pass, "rfc3610_ccm_aes128_8_13_pass", Ccm); +aead::new_fail_test!(rfc3610_ccm_aes128_8_13_fail, "rfc3610_ccm_aes128_8_13_fail", Ccm); +aead::new_pass_test!(rfc3610_ccm_aes128_10_13_pass, "rfc3610_ccm_aes128_10_13_pass", Ccm); +aead::new_fail_test!(rfc3610_ccm_aes128_10_13_fail, "rfc3610_ccm_aes128_10_13_fail", Ccm); // Test vectors from CAVP: // https://csrc.nist.gov/Projects/cryptographic-algorithm-validation-program/CAVP-TESTING-BLOCK-CIPHER-MODES -aead::new_test!(cavp_ccm_aes128_4_7, "cavp_ccm_aes128_4_7", Ccm); -aead::new_test!(cavp_ccm_aes128_4_13, "cavp_ccm_aes128_4_13", Ccm); -aead::new_test!(cavp_ccm_aes128_6_13, "cavp_ccm_aes128_6_13", Ccm); -aead::new_test!(cavp_ccm_aes128_8_13, "cavp_ccm_aes128_8_13", Ccm); -aead::new_test!(cavp_ccm_aes128_10_13, "cavp_ccm_aes128_10_13", Ccm); -aead::new_test!(cavp_ccm_aes128_12_13, "cavp_ccm_aes128_12_13", Ccm); -aead::new_test!(cavp_ccm_aes128_14_13, "cavp_ccm_aes128_14_13", Ccm); -aead::new_test!(cavp_ccm_aes128_16_7, "cavp_ccm_aes128_16_7", Ccm); -aead::new_test!(cavp_ccm_aes128_16_8, "cavp_ccm_aes128_16_8", Ccm); -aead::new_test!(cavp_ccm_aes128_16_9, "cavp_ccm_aes128_16_9", Ccm); -aead::new_test!(cavp_ccm_aes128_16_10, "cavp_ccm_aes128_16_10", Ccm); -aead::new_test!(cavp_ccm_aes128_16_11, "cavp_ccm_aes128_16_11", Ccm); -aead::new_test!(cavp_ccm_aes128_16_12, "cavp_ccm_aes128_16_12", Ccm); -aead::new_test!(cavp_ccm_aes128_16_13, "cavp_ccm_aes128_16_13", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_4_7_pass, "cavp_ccm_aes128_4_7_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_4_7_fail, "cavp_ccm_aes128_4_7_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_4_13_pass, "cavp_ccm_aes128_4_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_4_13_fail, "cavp_ccm_aes128_4_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_6_13_pass, "cavp_ccm_aes128_6_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_6_13_fail, "cavp_ccm_aes128_6_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_8_13_pass, "cavp_ccm_aes128_8_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_8_13_fail, "cavp_ccm_aes128_8_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_10_13_pass, "cavp_ccm_aes128_10_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_10_13_fail, "cavp_ccm_aes128_10_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_12_13_pass, "cavp_ccm_aes128_12_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_12_13_fail, "cavp_ccm_aes128_12_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_14_13_pass, "cavp_ccm_aes128_14_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_14_13_fail, "cavp_ccm_aes128_14_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_16_7_pass, "cavp_ccm_aes128_16_7_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_16_7_fail, "cavp_ccm_aes128_16_7_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_16_8_pass, "cavp_ccm_aes128_16_8_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_16_8_fail, "cavp_ccm_aes128_16_8_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_16_9_pass, "cavp_ccm_aes128_16_9_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_16_9_fail, "cavp_ccm_aes128_16_9_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_16_10_pass, "cavp_ccm_aes128_16_10_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_16_10_fail, "cavp_ccm_aes128_16_10_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_16_11_pass, "cavp_ccm_aes128_16_11_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_16_11_fail, "cavp_ccm_aes128_16_11_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_16_12_pass, "cavp_ccm_aes128_16_12_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_16_12_fail, "cavp_ccm_aes128_16_12_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes128_16_13_pass, "cavp_ccm_aes128_16_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes128_16_13_fail, "cavp_ccm_aes128_16_13_fail", Ccm); -aead::new_test!(cavp_ccm_aes192_4_7, "cavp_ccm_aes192_4_7", Ccm); -aead::new_test!(cavp_ccm_aes192_4_13, "cavp_ccm_aes192_4_13", Ccm); -aead::new_test!(cavp_ccm_aes192_6_13, "cavp_ccm_aes192_6_13", Ccm); -aead::new_test!(cavp_ccm_aes192_8_13, "cavp_ccm_aes192_8_13", Ccm); -aead::new_test!(cavp_ccm_aes192_10_13, "cavp_ccm_aes192_10_13", Ccm); -aead::new_test!(cavp_ccm_aes192_12_13, "cavp_ccm_aes192_12_13", Ccm); -aead::new_test!(cavp_ccm_aes192_14_13, "cavp_ccm_aes192_14_13", Ccm); -aead::new_test!(cavp_ccm_aes192_16_7, "cavp_ccm_aes192_16_7", Ccm); -aead::new_test!(cavp_ccm_aes192_16_8, "cavp_ccm_aes192_16_8", Ccm); -aead::new_test!(cavp_ccm_aes192_16_9, "cavp_ccm_aes192_16_9", Ccm); -aead::new_test!(cavp_ccm_aes192_16_10, "cavp_ccm_aes192_16_10", Ccm); -aead::new_test!(cavp_ccm_aes192_16_11, "cavp_ccm_aes192_16_11", Ccm); -aead::new_test!(cavp_ccm_aes192_16_12, "cavp_ccm_aes192_16_12", Ccm); -aead::new_test!(cavp_ccm_aes192_16_13, "cavp_ccm_aes192_16_13", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_4_7_pass, "cavp_ccm_aes192_4_7_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_4_7_fail, "cavp_ccm_aes192_4_7_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_4_13_pass, "cavp_ccm_aes192_4_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_4_13_fail, "cavp_ccm_aes192_4_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_6_13_pass, "cavp_ccm_aes192_6_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_6_13_fail, "cavp_ccm_aes192_6_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_8_13_pass, "cavp_ccm_aes192_8_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_8_13_fail, "cavp_ccm_aes192_8_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_10_13_pass, "cavp_ccm_aes192_10_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_10_13_fail, "cavp_ccm_aes192_10_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_12_13_pass, "cavp_ccm_aes192_12_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_12_13_fail, "cavp_ccm_aes192_12_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_14_13_pass, "cavp_ccm_aes192_14_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_14_13_fail, "cavp_ccm_aes192_14_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_16_7_pass, "cavp_ccm_aes192_16_7_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_16_7_fail, "cavp_ccm_aes192_16_7_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_16_8_pass, "cavp_ccm_aes192_16_8_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_16_8_fail, "cavp_ccm_aes192_16_8_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_16_9_pass, "cavp_ccm_aes192_16_9_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_16_9_fail, "cavp_ccm_aes192_16_9_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_16_10_pass, "cavp_ccm_aes192_16_10_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_16_10_fail, "cavp_ccm_aes192_16_10_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_16_11_pass, "cavp_ccm_aes192_16_11_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_16_11_fail, "cavp_ccm_aes192_16_11_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_16_12_pass, "cavp_ccm_aes192_16_12_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_16_12_fail, "cavp_ccm_aes192_16_12_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes192_16_13_pass, "cavp_ccm_aes192_16_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes192_16_13_fail, "cavp_ccm_aes192_16_13_fail", Ccm); -aead::new_test!(cavp_ccm_aes256_4_7, "cavp_ccm_aes256_4_7", Ccm); -aead::new_test!(cavp_ccm_aes256_4_13, "cavp_ccm_aes256_4_13", Ccm); -aead::new_test!(cavp_ccm_aes256_6_13, "cavp_ccm_aes256_6_13", Ccm); -aead::new_test!(cavp_ccm_aes256_8_13, "cavp_ccm_aes256_8_13", Ccm); -aead::new_test!(cavp_ccm_aes256_10_13, "cavp_ccm_aes256_10_13", Ccm); -aead::new_test!(cavp_ccm_aes256_12_13, "cavp_ccm_aes256_12_13", Ccm); -aead::new_test!(cavp_ccm_aes256_14_13, "cavp_ccm_aes256_14_13", Ccm); -aead::new_test!(cavp_ccm_aes256_16_7, "cavp_ccm_aes256_16_7", Ccm); -aead::new_test!(cavp_ccm_aes256_16_8, "cavp_ccm_aes256_16_8", Ccm); -aead::new_test!(cavp_ccm_aes256_16_9, "cavp_ccm_aes256_16_9",Ccm); -aead::new_test!(cavp_ccm_aes256_16_10, "cavp_ccm_aes256_16_10", Ccm); -aead::new_test!(cavp_ccm_aes256_16_11, "cavp_ccm_aes256_16_11", Ccm); -aead::new_test!(cavp_ccm_aes256_16_12, "cavp_ccm_aes256_16_12", Ccm); -aead::new_test!(cavp_ccm_aes256_16_13, "cavp_ccm_aes256_16_13", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_4_7_pass, "cavp_ccm_aes256_4_7_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_4_7_fail, "cavp_ccm_aes256_4_7_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_4_13_pass, "cavp_ccm_aes256_4_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_4_13_fail, "cavp_ccm_aes256_4_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_6_13_pass, "cavp_ccm_aes256_6_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_6_13_fail, "cavp_ccm_aes256_6_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_8_13_pass, "cavp_ccm_aes256_8_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_8_13_fail, "cavp_ccm_aes256_8_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_10_13_pass, "cavp_ccm_aes256_10_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_10_13_fail, "cavp_ccm_aes256_10_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_12_13_pass, "cavp_ccm_aes256_12_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_12_13_fail, "cavp_ccm_aes256_12_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_14_13_pass, "cavp_ccm_aes256_14_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_14_13_fail, "cavp_ccm_aes256_14_13_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_16_7_pass, "cavp_ccm_aes256_16_7_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_16_7_fail, "cavp_ccm_aes256_16_7_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_16_8_pass, "cavp_ccm_aes256_16_8_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_16_8_fail, "cavp_ccm_aes256_16_8_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_16_9_pass, "cavp_ccm_aes256_16_9_pass",Ccm); +aead::new_fail_test!(cavp_ccm_aes256_16_9_fail, "cavp_ccm_aes256_16_9_fail",Ccm); +aead::new_pass_test!(cavp_ccm_aes256_16_10_pass, "cavp_ccm_aes256_16_10_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_16_10_fail, "cavp_ccm_aes256_16_10_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_16_11_pass, "cavp_ccm_aes256_16_11_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_16_11_fail, "cavp_ccm_aes256_16_11_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_16_12_pass, "cavp_ccm_aes256_16_12_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_16_12_fail, "cavp_ccm_aes256_16_12_fail", Ccm); +aead::new_pass_test!(cavp_ccm_aes256_16_13_pass, "cavp_ccm_aes256_16_13_pass", Ccm); +aead::new_fail_test!(cavp_ccm_aes256_16_13_fail, "cavp_ccm_aes256_16_13_fail", Ccm); diff --git a/chacha20poly1305/Cargo.toml b/chacha20poly1305/Cargo.toml index c0d01e47..79c0905d 100644 --- a/chacha20poly1305/Cargo.toml +++ b/chacha20poly1305/Cargo.toml @@ -35,7 +35,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] reduced-round = [] zeroize = ["dep:zeroize", "chacha20/zeroize"] diff --git a/chacha20poly1305/src/lib.rs b/chacha20poly1305/src/lib.rs index d829f8a7..7625356b 100644 --- a/chacha20poly1305/src/lib.rs +++ b/chacha20poly1305/src/lib.rs @@ -50,17 +50,20 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will +//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the +//! [`aead`] crate as [`aead::bytes::BytesMut`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! -#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] -#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] +#![cfg_attr(all(feature = "os_rng", feature = "arrayvec"), doc = "```")] +#![cfg_attr(not(all(feature = "os_rng", feature = "arrayvec")), doc = "```ignore")] //! # fn main() -> Result<(), Box> { //! use chacha20poly1305::{ -//! aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, heapless::Vec}, +//! aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, arrayvec::ArrayVec}, //! ChaCha20Poly1305, Nonce, //! }; //! @@ -68,28 +71,22 @@ //! let cipher = ChaCha20Poly1305::new(&key); //! let nonce = ChaCha20Poly1305::generate_nonce().expect("Generate nonce"); // 96-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); // Note: buffer needs 16-bytes overhead for auth tag -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); // Note: buffer needs 16-bytes overhead for auth tag +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(&nonce, b"", &mut buffer)?; //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(&nonce, b"", &mut buffer)?; -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # Ok(()) //! # } //! ``` //! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will -//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the -//! [`aead`] crate as [`aead::bytes::BytesMut`]). -//! //! ## [`XChaCha20Poly1305`] //! //! ChaCha20Poly1305 variant with an extended 192-bit (24-byte) nonce. diff --git a/chacha20poly1305/tests/data/wycheproof_chacha20poly1305.blb b/chacha20poly1305/tests/data/wycheproof_chacha20poly1305.blb deleted file mode 100644 index 0c8d3306..00000000 Binary files a/chacha20poly1305/tests/data/wycheproof_chacha20poly1305.blb and /dev/null differ diff --git a/chacha20poly1305/tests/data/wycheproof_chacha20poly1305_fail.blb b/chacha20poly1305/tests/data/wycheproof_chacha20poly1305_fail.blb new file mode 100644 index 00000000..1922bbf8 Binary files /dev/null and b/chacha20poly1305/tests/data/wycheproof_chacha20poly1305_fail.blb differ diff --git a/chacha20poly1305/tests/data/wycheproof_chacha20poly1305_pass.blb b/chacha20poly1305/tests/data/wycheproof_chacha20poly1305_pass.blb new file mode 100644 index 00000000..b0f191b9 Binary files /dev/null and b/chacha20poly1305/tests/data/wycheproof_chacha20poly1305_pass.blb differ diff --git a/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305.blb b/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305.blb deleted file mode 100644 index cf0a2646..00000000 Binary files a/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305.blb and /dev/null differ diff --git a/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305_fail.blb b/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305_fail.blb new file mode 100644 index 00000000..f9c3458d Binary files /dev/null and b/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305_fail.blb differ diff --git a/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305_pass.blb b/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305_pass.blb new file mode 100644 index 00000000..8d1137c8 Binary files /dev/null and b/chacha20poly1305/tests/data/wycheproof_xchacha20poly1305_pass.blb differ diff --git a/chacha20poly1305/tests/lib.rs b/chacha20poly1305/tests/lib.rs index 0abd82c1..98d4184c 100644 --- a/chacha20poly1305/tests/lib.rs +++ b/chacha20poly1305/tests/lib.rs @@ -6,14 +6,24 @@ use chacha20poly1305::ChaCha20Poly1305; use chacha20poly1305::XChaCha20Poly1305; // Test vectors from Wycheproof -aead::new_test!( - wycheproof_chacha20poly1305, - "wycheproof_chacha20poly1305", +aead::new_pass_test!( + wycheproof_chacha20poly1305_pass, + "wycheproof_chacha20poly1305_pass", ChaCha20Poly1305 ); -aead::new_test!( - wycheproof_xchacha20poly1305, - "wycheproof_xchacha20poly1305", +aead::new_fail_test!( + wycheproof_chacha20poly1305_fail, + "wycheproof_chacha20poly1305_fail", + ChaCha20Poly1305 +); +aead::new_pass_test!( + wycheproof_xchacha20poly1305_pass, + "wycheproof_xchacha20poly1305_pass", + XChaCha20Poly1305 +); +aead::new_fail_test!( + wycheproof_xchacha20poly1305_fail, + "wycheproof_xchacha20poly1305_fail", XChaCha20Poly1305 ); diff --git a/deoxys/Cargo.toml b/deoxys/Cargo.toml index 3c510a7b..070f910a 100644 --- a/deoxys/Cargo.toml +++ b/deoxys/Cargo.toml @@ -33,7 +33,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] [package.metadata.docs.rs] diff --git a/deoxys/src/lib.rs b/deoxys/src/lib.rs index 4d9f92c6..59a0eacd 100644 --- a/deoxys/src/lib.rs +++ b/deoxys/src/lib.rs @@ -66,43 +66,40 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will +//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the +//! [`aead`] crate as [`aead::bytes::BytesMut`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! //! ``` -//! # #[cfg(feature = "heapless")] +//! # #[cfg(feature = "arrayvec")] //! # { //! use deoxys::{DeoxysII256, Nonce}; // Can be `DeoxysI128`, `DeoxysI256`, `DeoxysII128` of `DeoxysII256` -//! use deoxys::aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, heapless::Vec}; +//! use deoxys::aead::{AeadCore, AeadInOut, KeyInit, rand_core::OsRng, arrayvec::ArrayVec}; //! //! let key = DeoxysII256::generate_key().expect("generate key"); //! let cipher = DeoxysII256::new(&key); //! //! let nonce = DeoxysII256::generate_nonce().expect("generate nonce"); // 120-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); // Buffer needs 16-bytes overhead for tag -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); // Buffer needs 16-bytes overhead for tag +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(&nonce, b"", &mut buffer).expect("encryption failure!"); //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(&nonce, b"", &mut buffer).expect("decryption failure!"); -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # } //! ``` -//! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will -//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the -//! [`aead`] crate as [`aead::bytes::BytesMut`]). /// Deoxys-BC implementations. mod deoxys_bc; diff --git a/eax/Cargo.toml b/eax/Cargo.toml index 855bb269..aacba994 100644 --- a/eax/Cargo.toml +++ b/eax/Cargo.toml @@ -36,7 +36,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] [package.metadata.docs.rs] diff --git a/eax/src/lib.rs b/eax/src/lib.rs index 1abc7c64..0e11b16e 100644 --- a/eax/src/lib.rs +++ b/eax/src/lib.rs @@ -42,20 +42,23 @@ //! methods accept any type that impls the [`aead::Buffer`] trait which //! contains the plaintext for encryption or ciphertext for decryption. //! -//! Note that if you enable the `heapless` feature of this crate, -//! you will receive an impl of [`aead::Buffer`] for `heapless::Vec` -//! (re-exported from the [`aead`] crate as [`aead::heapless::Vec`]), -//! which can then be passed as the `buffer` parameter to the in-place encrypt +//! Enabling the `arrayvec` feature of this crate will provide an impl of +//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as +//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will +//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the +//! [`aead`] crate as [`aead::bytes::BytesMut`]). +//! +//! It can then be passed as the `buffer` parameter to the in-place encrypt //! and decrypt methods: //! //! ``` -//! # #[cfg(feature = "heapless")] +//! # #[cfg(feature = "arrayvec")] //! # { //! use aes::Aes256; //! use eax::Eax; //! use eax::aead::{ //! array::Array, -//! heapless::Vec, +//! arrayvec::ArrayVec, //! AeadCore, AeadInOut, KeyInit, rand_core::OsRng //! }; //! @@ -66,39 +69,33 @@ //! //! let nonce = Aes256Eax::generate_nonce().expect("generate nonce"); // 128-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! cipher.encrypt_in_place(&nonce, b"", &mut buffer).expect("encryption failure!"); //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_in_place(&nonce, b"", &mut buffer).expect("decryption failure!"); -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # } //! ``` //! -//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of -//! [`aead::Buffer`] for `arrayvec::ArrayVec` (re-exported from the [`aead`] crate as -//! [`aead::arrayvec::ArrayVec`]), and enabling the `bytes` feature of this crate will -//! provide an impl of [`aead::Buffer`] for `bytes::BytesMut` (re-exported from the -//! [`aead`] crate as [`aead::bytes::BytesMut`]). -//! //! ## Custom Tag Length //! //! The tag for eax is usually 16 bytes long but it can be shortened if needed. //! The second generic argument of `Eax` can be set to the tag length: //! //! ``` -//! # #[cfg(feature = "heapless")] +//! # #[cfg(feature = "arrayvec")] //! # { //! use aes::Aes256; //! use eax::Eax; //! use eax::aead::{AeadInOut, KeyInit, array::Array}; -//! use eax::aead::heapless::Vec; +//! use eax::aead::arrayvec::ArrayVec; //! use eax::aead::consts::{U8, U128}; //! //! let key = Array::from_slice(b"an example very very secret key."); @@ -106,8 +103,8 @@ //! //! let nonce = Array::from_slice(b"my unique nonces"); // 128-bits; unique per message //! -//! let mut buffer: Vec = Vec::new(); -//! buffer.extend_from_slice(b"plaintext message"); +//! let mut buffer: ArrayVec = ArrayVec::new(); +//! buffer.try_extend_from_slice(b"plaintext message").unwrap(); //! //! // Encrypt `buffer` in-place, replacing the plaintext contents with ciphertext //! let tag = cipher.encrypt_inout_detached(nonce, b"", buffer.as_mut_slice().into()).expect("encryption failure!"); @@ -116,11 +113,11 @@ //! assert_eq!(tag.len(), 8); //! //! // `buffer` now contains the message ciphertext -//! assert_ne!(&buffer, b"plaintext message"); +//! assert_ne!(buffer.as_ref(), b"plaintext message"); //! //! // Decrypt `buffer` in-place, replacing its ciphertext context with the original plaintext //! cipher.decrypt_inout_detached(nonce, b"", buffer.as_mut_slice().into(), &tag).expect("decryption failure!"); -//! assert_eq!(&buffer, b"plaintext message"); +//! assert_eq!(buffer.as_ref(), b"plaintext message"); //! # } //! ``` diff --git a/eax/tests/aes128eax.rs b/eax/tests/aes128eax.rs index 656648ae..1e871731 100644 --- a/eax/tests/aes128eax.rs +++ b/eax/tests/aes128eax.rs @@ -5,4 +5,5 @@ use aes::Aes128; use eax::Eax; -aead::new_test!(aes128eax, "aes128eax", Eax); +aead::new_pass_test!(aes128eax_pass, "aes128eax_pass", Eax); +aead::new_fail_test!(aes128eax_fail, "aes128eax_fail", Eax); diff --git a/eax/tests/data/aes128eax.blb b/eax/tests/data/aes128eax.blb deleted file mode 100644 index 3e1a3dec..00000000 Binary files a/eax/tests/data/aes128eax.blb and /dev/null differ diff --git a/eax/tests/data/aes128eax_fail.blb b/eax/tests/data/aes128eax_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/eax/tests/data/aes128eax_fail.blb differ diff --git a/eax/tests/data/aes128eax_pass.blb b/eax/tests/data/aes128eax_pass.blb new file mode 100644 index 00000000..3fa2d031 Binary files /dev/null and b/eax/tests/data/aes128eax_pass.blb differ diff --git a/mgm/Cargo.toml b/mgm/Cargo.toml index c4dc2b3a..e5b5bfa9 100644 --- a/mgm/Cargo.toml +++ b/mgm/Cargo.toml @@ -37,7 +37,6 @@ alloc = ["aead/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] getrandom = ["aead/getrandom", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] stream = ["aead/stream"] force-soft = [] # Disable support for hardware intrinsics diff --git a/ocb3/Cargo.toml b/ocb3/Cargo.toml index 0fc6323c..9e65f538 100644 --- a/ocb3/Cargo.toml +++ b/ocb3/Cargo.toml @@ -35,7 +35,6 @@ alloc = ["aead/alloc", "aead-stream?/alloc"] arrayvec = ["aead/arrayvec"] bytes = ["aead/bytes"] os_rng = ["aead/os_rng", "rand_core"] -heapless = ["aead/heapless"] rand_core = ["aead/rand_core"] [package.metadata.docs.rs] diff --git a/ocb3/tests/data/rfc7253_ocb_aes.blb b/ocb3/tests/data/rfc7253_ocb_aes.blb deleted file mode 100644 index 3b69db1a..00000000 Binary files a/ocb3/tests/data/rfc7253_ocb_aes.blb and /dev/null differ diff --git a/ocb3/tests/data/rfc7253_ocb_aes_fail.blb b/ocb3/tests/data/rfc7253_ocb_aes_fail.blb new file mode 100644 index 00000000..09f370e3 Binary files /dev/null and b/ocb3/tests/data/rfc7253_ocb_aes_fail.blb differ diff --git a/ocb3/tests/data/rfc7253_ocb_aes_pass.blb b/ocb3/tests/data/rfc7253_ocb_aes_pass.blb new file mode 100644 index 00000000..1685bb00 Binary files /dev/null and b/ocb3/tests/data/rfc7253_ocb_aes_pass.blb differ diff --git a/ocb3/tests/kats.rs b/ocb3/tests/kats.rs index 1b30c726..1b4355d2 100644 --- a/ocb3/tests/kats.rs +++ b/ocb3/tests/kats.rs @@ -9,7 +9,8 @@ use hex_literal::hex; use ocb3::{Array, Ocb3}; // Test vectors from https://www.rfc-editor.org/rfc/rfc7253.html#appendix-A -aead::new_test!(rfc7253_ocb_aes, "rfc7253_ocb_aes", Aes128Ocb3); +aead::new_pass_test!(rfc7253_ocb_aes_pass, "rfc7253_ocb_aes_pass", Aes128Ocb3); +aead::new_fail_test!(rfc7253_ocb_aes_fail, "rfc7253_ocb_aes_fail", Aes128Ocb3); fn num2str96(num: usize) -> [u8; 12] { let num: u32 = num.try_into().unwrap(); diff --git a/xaes-256-gcm/Cargo.toml b/xaes-256-gcm/Cargo.toml index c1a01c91..6e32dff9 100644 --- a/xaes-256-gcm/Cargo.toml +++ b/xaes-256-gcm/Cargo.toml @@ -31,7 +31,6 @@ default = ["alloc", "os_rng"] alloc = ["aead/alloc", "aead-stream?/alloc", "aes-gcm/alloc"] arrayvec = ["aead/arrayvec", "aes-gcm/arrayvec"] os_rng = ["aead/os_rng", "aes-gcm/os_rng", "rand_core"] -heapless = ["aead/heapless", "aes-gcm/heapless"] rand_core = ["aead/rand_core", "aes-gcm/rand_core"] [package.metadata.docs.rs] diff --git a/xaes-256-gcm/src/lib.rs b/xaes-256-gcm/src/lib.rs index d36c8fc3..c5af4ec5 100644 --- a/xaes-256-gcm/src/lib.rs +++ b/xaes-256-gcm/src/lib.rs @@ -12,8 +12,8 @@ //! //! Simple usage (allocating, no associated data): //! -#![cfg_attr(all(feature = "os_rng", feature = "heapless"), doc = "```")] -#![cfg_attr(not(all(feature = "os_rng", feature = "heapless")), doc = "```ignore")] +#![cfg_attr(feature = "os_rng", doc = "```")] +#![cfg_attr(not(feature = "os_rng"), doc = "```ignore")] //! use xaes_256_gcm::{ //! Xaes256Gcm, Nonce, Key, //! aead::{Aead, AeadCore, KeyInit, rand_core::OsRng},