chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

Binary file not shown.

BIN
vendor/blake2/tests/data/blake2b/mac.blb vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/blake2/tests/data/blake2s/mac.blb vendored Normal file

Binary file not shown.

Binary file not shown.

29
vendor/blake2/tests/mac.rs vendored Normal file
View File

@@ -0,0 +1,29 @@
#[cfg(not(feature = "reset"))]
use digest::new_mac_test as new_test;
#[cfg(feature = "reset")]
use digest::new_resettable_mac_test as new_test;
new_test!(blake2b_mac, "blake2b/mac", blake2::Blake2bMac512);
new_test!(blake2s_mac, "blake2s/mac", blake2::Blake2sMac256);
#[test]
fn blake2b_new_test() {
use blake2::digest::{generic_array::GenericArray, KeyInit, Mac};
fn run<T: Mac + KeyInit>(key: &[u8]) {
const DATA: &[u8] = &[42; 300];
let res1 = <T as Mac>::new(GenericArray::from_slice(key))
.chain_update(DATA)
.finalize()
.into_bytes();
let res2 = <T as Mac>::new_from_slice(&key)
.unwrap()
.chain_update(DATA)
.finalize()
.into_bytes();
assert_eq!(res1, res2);
}
run::<blake2::Blake2sMac256>(&[0x42; 32]);
run::<blake2::Blake2bMac512>(&[0x42; 64]);
}

19
vendor/blake2/tests/mod.rs vendored Normal file
View File

@@ -0,0 +1,19 @@
#[cfg(feature = "reset")]
use digest::dev::{fixed_reset_test as fixed_fn, variable_reset_test as varaible_fn};
#[cfg(not(feature = "reset"))]
use digest::dev::{fixed_test as fixed_fn, variable_test as varaible_fn};
use digest::new_test;
new_test!(blake2b_fixed, "blake2b/fixed", blake2::Blake2b512, fixed_fn,);
new_test!(
blake2b_variable,
"blake2b/variable",
blake2::Blake2bVar,
varaible_fn,
);
new_test!(
blake2s_variable,
"blake2s/variable",
blake2::Blake2sVar,
varaible_fn,
);

40
vendor/blake2/tests/persona.rs vendored Normal file
View File

@@ -0,0 +1,40 @@
use blake2::{digest::FixedOutput, Blake2bMac512, Blake2sMac256};
use hex_literal::hex;
#[test]
#[rustfmt::skip]
fn blake2s_persona() {
let key= hex!("
000102030405060708090a0b0c0d0e0f
101112131415161718191a1b1c1d1e1f
");
let persona = b"personal";
let ctx = Blake2sMac256::new_with_salt_and_personal(&key, &[], persona).unwrap();
assert_eq!(
ctx.finalize_fixed()[..],
hex!("
25a4ee63b594aed3f88a971e1877ef70
99534f9097291f88fb86c79b5e70d022
")[..],
);
}
#[test]
#[rustfmt::skip]
fn blake2b_persona() {
let key = hex!("
000102030405060708090a0b0c0d0e0f
101112131415161718191a1b1c1d1e1f
");
let persona = b"personal";
let ctx = Blake2bMac512::new_with_salt_and_personal(&key, &[], persona).unwrap();
assert_eq!(
ctx.finalize_fixed()[..],
hex!("
03de3b295dcfc3b25b05abb09bc95fe3
e9ff3073638badc68101d1e42019d077
1dd07525a3aae8318e92c5e5d967ba92
e4810d0021d7bf3b49da0b4b4a8a4e1f
")[..],
);
}