diff --git a/.github/workflows/aes-gcm-siv.yml b/.github/workflows/aes-gcm-siv.yml index b7b2d99c..8fb6ef1a 100644 --- a/.github/workflows/aes-gcm-siv.yml +++ b/.github/workflows/aes-gcm-siv.yml @@ -62,6 +62,7 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} - run: ${{ matrix.deps }} + - run: cargo test --target ${{ matrix.target }} --release --no-default-features - run: cargo test --target ${{ matrix.target }} --release - run: cargo test --target ${{ matrix.target }} --release --features stream,std - run: cargo test --target ${{ matrix.target }} --release --all-features diff --git a/.github/workflows/aes-gcm.yml b/.github/workflows/aes-gcm.yml index 60468494..9b7aa97c 100644 --- a/.github/workflows/aes-gcm.yml +++ b/.github/workflows/aes-gcm.yml @@ -62,6 +62,7 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} - 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 stream,std,zeroize - run: cargo test --target ${{ matrix.target }} --release --all-features diff --git a/.github/workflows/aes-siv.yml b/.github/workflows/aes-siv.yml index 807f7592..c8b7e61c 100644 --- a/.github/workflows/aes-siv.yml +++ b/.github/workflows/aes-siv.yml @@ -49,6 +49,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} + - run: cargo test --release --no-default-features - run: cargo test --release - run: cargo test --release --features stream,std - run: cargo test --release --all-features diff --git a/.github/workflows/ascon-aead.yml b/.github/workflows/ascon-aead.yml index 6691f148..61084f69 100644 --- a/.github/workflows/ascon-aead.yml +++ b/.github/workflows/ascon-aead.yml @@ -62,6 +62,7 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} - run: ${{ matrix.deps }} + - run: cargo test --target ${{ matrix.target }} --release --no-default-features - run: cargo test --target ${{ matrix.target }} --release - run: cargo test --target ${{ matrix.target }} --release --features std,zeroize - run: cargo test --target ${{ matrix.target }} --release --all-features diff --git a/.github/workflows/ccm.yml b/.github/workflows/ccm.yml index 4a0f360f..122f9b94 100644 --- a/.github/workflows/ccm.yml +++ b/.github/workflows/ccm.yml @@ -61,6 +61,7 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} - run: ${{ matrix.deps }} + - run: cargo test --target ${{ matrix.target }} --release --no-default-features - run: cargo test --target ${{ matrix.target }} --release - run: cargo test --target ${{ matrix.target }} --release --all-features - run: cargo build --target ${{ matrix.target }} --benches diff --git a/.github/workflows/deoxys.yml b/.github/workflows/deoxys.yml index 8d475386..3382d590 100644 --- a/.github/workflows/deoxys.yml +++ b/.github/workflows/deoxys.yml @@ -49,6 +49,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} + - run: cargo test --release --no-default-features - run: cargo test --release - run: cargo test --release --features stream,std - run: cargo test --release --all-features diff --git a/.github/workflows/eax.yml b/.github/workflows/eax.yml index 2a31fad0..cdc97a15 100644 --- a/.github/workflows/eax.yml +++ b/.github/workflows/eax.yml @@ -48,6 +48,6 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} + - run: cargo test --release --no-default-features - run: cargo test --release - run: cargo test --release --all-features - - run: cargo test --release --no-default-features diff --git a/.github/workflows/mgm.yml b/.github/workflows/mgm.yml index 7d74cb07..ca91fb9b 100644 --- a/.github/workflows/mgm.yml +++ b/.github/workflows/mgm.yml @@ -48,6 +48,7 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} + - run: cargo test --release --no-default-features - run: cargo test --release - run: cargo test --release --features force-soft - run: cargo test --release --features stream,std diff --git a/aes-gcm-siv/tests/aes128gcmsiv.rs b/aes-gcm-siv/tests/aes128gcmsiv.rs index 5b759b87..18bdd9e4 100644 --- a/aes-gcm-siv/tests/aes128gcmsiv.rs +++ b/aes-gcm-siv/tests/aes128gcmsiv.rs @@ -1,5 +1,7 @@ //! AES-128-auth tag-SIV tests +#![cfg(all(feature = "aes", feature = "alloc"))] + #[macro_use] mod common; diff --git a/aes-gcm-siv/tests/aes256gcmsiv.rs b/aes-gcm-siv/tests/aes256gcmsiv.rs index c9f625b6..9e2eed28 100644 --- a/aes-gcm-siv/tests/aes256gcmsiv.rs +++ b/aes-gcm-siv/tests/aes256gcmsiv.rs @@ -1,5 +1,7 @@ //! AES-256-auth tag-SIV tests +#![cfg(all(feature = "aes", feature = "alloc"))] + #[macro_use] mod common; diff --git a/aes-gcm-siv/tests/ctr_wrap.rs b/aes-gcm-siv/tests/ctr_wrap.rs index e064e34b..e86f8563 100644 --- a/aes-gcm-siv/tests/ctr_wrap.rs +++ b/aes-gcm-siv/tests/ctr_wrap.rs @@ -3,6 +3,8 @@ //! The tests use `Aes256GcmSiv` and are crafted to test correct wrapping of //! the block counter. +#![cfg(all(feature = "aes", feature = "alloc"))] + #[macro_use] mod common; diff --git a/aes-gcm/src/lib.rs b/aes-gcm/src/lib.rs index 4006c368..f7a26513 100644 --- a/aes-gcm/src/lib.rs +++ b/aes-gcm/src/lib.rs @@ -35,7 +35,7 @@ //! //! # fn main() -> Result<(), aes_gcm::Error> { //! // Alternatively, the key can be transformed directly from a byte slice -//! // (panicks on length mismatch): +//! // (panics on length mismatch): //! # let key: &[u8] = &[42; 32]; //! let key = Key::::from_slice(key); //! diff --git a/aes-gcm/tests/aes128gcm.rs b/aes-gcm/tests/aes128gcm.rs index 8834636f..7b84fbcb 100644 --- a/aes-gcm/tests/aes128gcm.rs +++ b/aes-gcm/tests/aes128gcm.rs @@ -1,5 +1,7 @@ //! AES-128-auth tag tests +#![cfg(all(feature = "aes", feature = "alloc"))] + #[macro_use] mod common; diff --git a/aes-gcm/tests/aes256gcm.rs b/aes-gcm/tests/aes256gcm.rs index dd701d5f..f1fdda5d 100644 --- a/aes-gcm/tests/aes256gcm.rs +++ b/aes-gcm/tests/aes256gcm.rs @@ -1,5 +1,7 @@ //! AES-256-auth tag tests +#![cfg(all(feature = "aes", feature = "alloc"))] + #[macro_use] mod common; diff --git a/aes-gcm/tests/other_ivlen.rs b/aes-gcm/tests/other_ivlen.rs index 71d3c770..124647fb 100644 --- a/aes-gcm/tests/other_ivlen.rs +++ b/aes-gcm/tests/other_ivlen.rs @@ -3,6 +3,8 @@ //! Vectors taken from NIST CAVS vectors' `gcmEncryptExtIV128.rsp` file: //! +#![cfg(all(feature = "aes", feature = "alloc"))] + use aead::{ generic_array::{typenum, GenericArray}, Aead, KeyInit, diff --git a/aes-siv/tests/aead.rs b/aes-siv/tests/aead.rs index f444b359..48f276cf 100644 --- a/aes-siv/tests/aead.rs +++ b/aes-siv/tests/aead.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "alloc")] + #[macro_use] extern crate hex_literal; diff --git a/aes-siv/tests/siv.rs b/aes-siv/tests/siv.rs index 6e1cdd60..0db1a2e9 100644 --- a/aes-siv/tests/siv.rs +++ b/aes-siv/tests/siv.rs @@ -1,5 +1,7 @@ //! AES-SIV tests for the raw SIV interface +#![cfg(feature = "alloc")] + use aes_siv::aead::generic_array::GenericArray; /// Test vectors diff --git a/ccm/tests/mod.rs b/ccm/tests/mod.rs index 59b8d9bd..1ead71b2 100644 --- a/ccm/tests/mod.rs +++ b/ccm/tests/mod.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "alloc")] + use aead::{generic_array::GenericArray, Aead, AeadInPlace, KeyInit, Payload}; use aes::{Aes128, Aes192, Aes256}; use ccm::{ diff --git a/deoxys/tests/deoxys_i_128.rs b/deoxys/tests/deoxys_i_128.rs index d6e50526..b2fee03a 100644 --- a/deoxys/tests/deoxys_i_128.rs +++ b/deoxys/tests/deoxys_i_128.rs @@ -1,4 +1,7 @@ -// Uses the official test vectors. +//! Uses the official test vectors. + +#![cfg(feature = "alloc")] + use deoxys::aead::generic_array::GenericArray; use deoxys::aead::{Aead, KeyInit, Payload}; use deoxys::DeoxysI128; diff --git a/deoxys/tests/deoxys_i_256.rs b/deoxys/tests/deoxys_i_256.rs index 999e4fb7..207d25d3 100644 --- a/deoxys/tests/deoxys_i_256.rs +++ b/deoxys/tests/deoxys_i_256.rs @@ -1,4 +1,7 @@ -// Uses the official test vectors. +//! Uses the official test vectors. + +#![cfg(feature = "alloc")] + use deoxys::aead::generic_array::GenericArray; use deoxys::aead::{Aead, KeyInit, Payload}; use deoxys::DeoxysI256; diff --git a/deoxys/tests/deoxys_ii_128.rs b/deoxys/tests/deoxys_ii_128.rs index 990fd981..dad16fd5 100644 --- a/deoxys/tests/deoxys_ii_128.rs +++ b/deoxys/tests/deoxys_ii_128.rs @@ -1,4 +1,7 @@ -// Uses the official test vectors. +//! Uses the official test vectors. + +#![cfg(feature = "alloc")] + use deoxys::aead::generic_array::GenericArray; use deoxys::aead::{Aead, KeyInit, Payload}; use deoxys::DeoxysII128; diff --git a/deoxys/tests/deoxys_ii_256.rs b/deoxys/tests/deoxys_ii_256.rs index 85669242..5af92334 100644 --- a/deoxys/tests/deoxys_ii_256.rs +++ b/deoxys/tests/deoxys_ii_256.rs @@ -1,4 +1,7 @@ -// Uses the official test vectors. +//! Uses the official test vectors. + +#![cfg(feature = "alloc")] + use deoxys::aead::generic_array::GenericArray; use deoxys::aead::{Aead, KeyInit, Payload}; use deoxys::DeoxysII256; diff --git a/mgm/tests/bad_nonce.rs b/mgm/tests/bad_nonce.rs index a12d7fe5..8390e0b8 100644 --- a/mgm/tests/bad_nonce.rs +++ b/mgm/tests/bad_nonce.rs @@ -1,4 +1,7 @@ //! Tests for nonce validity checks + +#![cfg(feature = "alloc")] + use aead::{generic_array::GenericArray, Aead, KeyInit}; use mgm::Mgm; diff --git a/mgm/tests/rfc9058.rs b/mgm/tests/rfc9058.rs index 47d680ee..bd2ee6e1 100644 --- a/mgm/tests/rfc9058.rs +++ b/mgm/tests/rfc9058.rs @@ -1,4 +1,6 @@ //! Test vectors from: https://datatracker.ietf.org/doc/html/rfc9058 +#![cfg(feature = "alloc")] + aead::new_test!(kuznyechik, "kuznyechik", mgm::Mgm); aead::new_test!(magma, "magma", mgm::Mgm);