Browse Source

Add test vector that tests endianness.

master
Sean Bowe 9 years ago
parent
commit
f84e4449a5
  1. 3
      src/keccak.rs

3
src/keccak.rs

@ -412,6 +412,9 @@ impl Bit {
#[test] #[test]
fn test_sha3_256() { fn test_sha3_256() {
let test_vector: Vec<(Vec<Byte>, [u8; 32])> = vec![ let test_vector: Vec<(Vec<Byte>, [u8; 32])> = vec![
(vec![Bit::byte(0x30), Bit::byte(0x31), Bit::byte(0x30), Bit::byte(0x31)],
[0xe5,0xbf,0x4a,0xd7,0xda,0x2b,0x4d,0x64,0x0d,0x2b,0x8d,0xd3,0xae,0x9b,0x6e,0x71,0xb3,0x6e,0x0f,0x3d,0xb7,0x6a,0x1e,0xc0,0xad,0x6b,0x87,0x2f,0x3e,0xcc,0x2e,0xbc]
),
(vec![Bit::byte(0x30)], (vec![Bit::byte(0x30)],
[0xf9,0xe2,0xea,0xaa,0x42,0xd9,0xfe,0x9e,0x55,0x8a,0x9b,0x8e,0xf1,0xbf,0x36,0x6f,0x19,0x0a,0xac,0xaa,0x83,0xba,0xd2,0x64,0x1e,0xe1,0x06,0xe9,0x04,0x10,0x96,0xe4] [0xf9,0xe2,0xea,0xaa,0x42,0xd9,0xfe,0x9e,0x55,0x8a,0x9b,0x8e,0xf1,0xbf,0x36,0x6f,0x19,0x0a,0xac,0xaa,0x83,0xba,0xd2,0x64,0x1e,0xe1,0x06,0xe9,0x04,0x10,0x96,0xe4]
), ),

Loading…
Cancel
Save