hazmat.rs
Rust test marker or harnessimports aes::Block
SHA-256f45e6bfd85d01c9909e22c85ff58c6f919d552c9bbaf4b9c01e56b07557b7789
MaleculeO(As)Md₂(In₂Pa)
Evidence
1//! Tests for low-level "hazmat" AES functions.
2
3#![cfg(all(feature = "hazmat", not(feature = "force-soft")))]
4
5use aes::Block;
6use hex_literal::hex;
7
8/// Round function tests vectors.
⋯5 lines
21:51… ] = &[
22 // round 1
23 RoundTestVector {
24 start: hex!("00102030405060708090a0b0c0d0e0f0"),
25 k_sch: hex!("d6aa74fdd2af72fadaa678f1d6ab76fe"),
26 output: hex!("89d810e8855ace682d1843d8cb128fe4"),
27 },
28 // round 2
29 RoundTestVector {
30 start: hex!("89d810e8855ace682d1843d8cb128fe4"),
31 k_sch: hex!("b692cf0b643dbdf1be9bc5006830b3fe"),
32 output: hex!("4915598f55e5d7a0daca94fa1f0a63f7"),
33 },
34 // round 3
35 RoundTestVector {
36 start: hex!("4915598f55e5d7a0daca94fa1f0a63f7"),
37 k_sch: hex!("b6ff744ed2c2c9bf6c590cbf0469bf41"),
38 output: hex!("fa636a2825b339c940668a3157244d17"),
39 },
40 // round 4
41 RoundTestVector {
42 start: hex!("fa636a2825b339c940668a3157244d17"),
43 k_sch: hex!("47f7f7bc95353e03f96c32bcfd058dfd"),
44 output: hex!("247240236966b3fa6ed2753288425b6c"),
45 },
46];
47
48/// Equivalent Inverse Cipher round function test vector …
72:6… output: hex!("e8dab6901477d4653ff7f5e2e747dd4f"),
73 },
74];
75
76#[test]
77fn cipher_round_fips197_vectors() {
78 for vector in CIPHER_ROUND_TEST_VECTORS {
79 let mut block = Block::from(vector.st …