Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ members = [
[patch.crates-io]
aead-stream = { path = "aead-stream" }
aes-gcm = { path = "aes-gcm" }

# https://github.com/RustCrypto/utils/pull/1187
blobby = { git = "https://github.com/RustCrypto/utils" }
2 changes: 1 addition & 1 deletion aead-stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }

[features]
alloc = ["aead/alloc"]
4 changes: 2 additions & 2 deletions aes-gcm-siv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
aes = { version = "0.9.0-rc.1", optional = true }
cipher = "0.5.0-rc.1"
ctr = "0.10.0-rc.1"
Expand All @@ -26,7 +26,7 @@ subtle = { version = "2", default-features = false }
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }

[features]
default = ["aes", "alloc", "os_rng"]
Expand Down
Binary file modified aes-gcm-siv/tests/data/wycheproof-128.blb
Binary file not shown.
Binary file modified aes-gcm-siv/tests/data/wycheproof-256.blb
Binary file not shown.
4 changes: 2 additions & 2 deletions aes-gcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
aes = { version = "0.9.0-rc.1", optional = true }
cipher = "0.5.0-rc.1"
ctr = "0.10.0-rc.1"
Expand All @@ -26,7 +26,7 @@ subtle = { version = "2", default-features = false }
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["alloc", "dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["alloc", "dev"], default-features = false }
hex-literal = "1"

[features]
Expand Down
Binary file modified aes-gcm/tests/data/wycheproof-128.blb
Binary file not shown.
Binary file modified aes-gcm/tests/data/wycheproof-256.blb
Binary file not shown.
4 changes: 2 additions & 2 deletions aes-siv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = "0.6.0-rc.1"
aead = "0.6.0-rc.2"
aes = "0.9.0-rc.1"
cipher = "0.5.0-rc.1"
cmac = "0.8.0-rc.1"
Expand All @@ -30,7 +30,7 @@ zeroize = { version = "1", optional = true, default-features = false }
pmac = { version = "0.8.0-rc.1", optional = true }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["alloc", "dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["alloc", "dev"], default-features = false }
blobby = "0.4.0-pre.0"
hex-literal = "1"

Expand Down
Binary file modified aes-siv/tests/data/wycheproof-256.blb
Binary file not shown.
Binary file modified aes-siv/tests/data/wycheproof-512.blb
Binary file not shown.
16 changes: 11 additions & 5 deletions aes-siv/tests/siv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ macro_rules! wycheproof_tests {
($siv:ty, $name:ident, $test_name:expr) => {
#[test]
fn $name() {
use blobby::Blob5Iterator;
use aead::dev::TestVector;

aead::dev::blobby::parse_into_structs!(
include_bytes!(concat!("data/", $test_name, ".blb"));
static TEST_VECTORS: &[
TestVector { key, nonce, aad, plaintext, ciphertext, pass }
];
);

let data = include_bytes!(concat!("data/", $test_name, ".blb"));
fn run_test(
key: &[u8],
aad: &[u8],
Expand Down Expand Up @@ -86,9 +92,9 @@ macro_rules! wycheproof_tests {
}
}

for (i, row) in Blob5Iterator::new(data).unwrap().enumerate() {
let [key, aad, pt, ct, status] = row.unwrap();
let pass = match status[0] {
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"),
Expand Down
4 changes: 2 additions & 2 deletions ascon-aead128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
subtle = { version = "2", default-features = false }
zeroize = { version = "1.6", optional = true, default-features = false, features = ["derive"] }
ascon = "0.4"

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["dev"] }
aead = { version = "0.6.0-rc.2", features = ["dev"] }

[features]
default = ["alloc", "os_rng"]
Expand Down
Binary file modified ascon-aead128/tests/data/reference_kats.blb
Binary file not shown.
64 changes: 2 additions & 62 deletions ascon-aead128/tests/reference_kats.rs
Original file line number Diff line number Diff line change
@@ -1,65 +1,5 @@
#![cfg(feature = "alloc")] // TODO: remove after migration to the new `aead` crate
use ascon_aead128::{
AsconAead128,
aead::{Aead, KeyInit, Nonce, Payload, dev::blobby},
};

fn run_pass_test<C: Aead>(
cipher: &C,
nonce: &Nonce<C>,
aad: &[u8],
pt: &[u8],
ct: &[u8],
) -> Result<(), &'static str> {
let res = cipher
.encrypt(nonce, Payload { aad, msg: pt })
.map_err(|_| "encryption failure")?;
if res != ct {
return Err("encrypted data is different from target ciphertext");
}

let res = cipher
.decrypt(nonce, Payload { aad, msg: ct })
.map_err(|_| "decryption failure")?;
if res != pt {
return Err("decrypted data is different from target plaintext");
}

Ok(())
}

#[macro_export]
macro_rules! new_pass_test {
($name:ident, $test_name:expr, $cipher:ty $(,)?) => {
#[test]
fn $name() {
use blobby::Blob5Iterator;
use $crate::KeyInit;

let data = include_bytes!(concat!("data/", $test_name, ".blb"));
for (i, row) in Blob5Iterator::new(data).unwrap().enumerate() {
let [key, nonce, aad, pt, ct] = row.unwrap();
let key = key.try_into().expect("wrong key size");
let nonce = nonce.try_into().expect("wrong nonce size");
let cipher = <$cipher as KeyInit>::new(key);
let res = run_pass_test(&cipher, nonce, aad, pt, ct);
if let Err(reason) = res {
panic!(
"\n\
Failed (pass) test #{i}\n\
reason:\t{reason:?}\n\
key:\t{key:?}\n\
nonce:\t{nonce:?}\n\
aad:\t{aad:?}\n\
plaintext:\t{pt:?}\n\
ciphertext:\t{ct:?}\n"
);
}
}
}
};
}
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
new_pass_test!(ascon_aead_reference_kats, "reference_kats", AsconAead128);
aead::new_test!(ascon_aead_reference_kats, "reference_kats", AsconAead128);
2 changes: 1 addition & 1 deletion belt-dwp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
belt-block = { version = "0.2.0-rc.1" }
belt-ctr = { version = "0.2.0-rc.1" }
opaque-debug = { version = "0.3" }
Expand Down
4 changes: 2 additions & 2 deletions ccm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ keywords = ["encryption", "aead"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
cipher = { version = "0.5.0-rc.1", default-features = false }
ctr = { version = "0.10.0-rc.1", default-features = false }
subtle = { version = "2", default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }
aes = { version = "0.9.0-rc.1" }
hex-literal = "1"

Expand Down
Binary file modified ccm/tests/data/cavp_ccm_aes128_10_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_12_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_14_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_16_10.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_16_11.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_16_12.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_16_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_16_7.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_16_8.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_16_9.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_4_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_4_7.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_6_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes128_8_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_10_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_12_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_14_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_16_10.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_16_11.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_16_12.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_16_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_16_7.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_16_8.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_16_9.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_4_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_4_7.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_6_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes192_8_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_10_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_12_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_14_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_16_10.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_16_11.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_16_12.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_16_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_16_7.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_16_8.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_16_9.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_4_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_4_7.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_6_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/cavp_ccm_aes256_8_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/rfc3610_ccm_aes128_10_13.blb
Binary file not shown.
Binary file modified ccm/tests/data/rfc3610_ccm_aes128_8_13.blb
Binary file not shown.
4 changes: 2 additions & 2 deletions chacha20poly1305/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
chacha20 = { version = "0.10.0-rc.2", default-features = false, features = ["xchacha"] }
cipher = "0.5.0-rc.1"
poly1305 = "0.9.0-rc.2"
zeroize = { version = "1.8", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }

[features]
default = ["alloc", "os_rng"]
Expand Down
Binary file modified chacha20poly1305/tests/data/wycheproof_chacha20poly1305.blb
Binary file not shown.
Binary file modified chacha20poly1305/tests/data/wycheproof_xchacha20poly1305.blb
Binary file not shown.
4 changes: 2 additions & 2 deletions deoxys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ edition = "2024"
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
aes = { version = "0.9.0-rc.1", features = ["hazmat"], default-features = false }
subtle = { version = "2", default-features = false }
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }
hex-literal = "1"

[features]
Expand Down
4 changes: 2 additions & 2 deletions eax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
cipher = "0.5.0-rc.1"
cmac = "0.8.0-rc.1"
ctr = "0.10.0-rc.1"
subtle = { version = "2", default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }
aes = "0.9.0-rc.1"

[features]
Expand Down
Binary file modified eax/tests/data/aes128eax.blb
Binary file not shown.
4 changes: 2 additions & 2 deletions ocb3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
cipher = "0.5.0-rc.1"
ctr = "0.10.0-rc.1"
dbl = "0.5"
Expand All @@ -25,7 +25,7 @@ aead-stream = { version = "0.6.0-rc.1", optional = true, default-features = fals
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.0", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }
aes = { version = "0.9.0-rc.1", default-features = false }
hex-literal = "0.4"

Expand Down
Binary file modified ocb3/tests/data/rfc7253_ocb_aes.blb
Binary file not shown.
4 changes: 2 additions & 2 deletions xaes-256-gcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ categories = ["cryptography", "no-std"]
rust-version = "1.85"

[dependencies]
aead = { version = "0.6.0-rc.1", default-features = false }
aead = { version = "0.6.0-rc.2", default-features = false }
aes = "0.9.0-rc.1"
aes-gcm = { version = "0.11.0-rc.1", default-features = false, features = ["aes"] }
cipher = "0.5.0-rc.1"
aead-stream = { version = "0.6.0-rc.1", optional = true, default-features = false }

[dev-dependencies]
aead = { version = "0.6.0-rc.1", features = ["dev"], default-features = false }
aead = { version = "0.6.0-rc.2", features = ["dev"], default-features = false }
hex-literal = "1"

[features]
Expand Down