Skip to content

Commit 023a943

Browse files
committed
Format dndk-gcm
1 parent da88ac7 commit 023a943

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

dndk-gcm/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ pub use aes;
3737
pub use aes_gcm;
3838

3939
use aead::{
40-
AeadCore, AeadInOut, Error, KeyInit, KeySizeUser, TagPosition, array::Array,
41-
inout::InOutBuf,
40+
AeadCore, AeadInOut, Error, KeyInit, KeySizeUser, TagPosition, array::Array, inout::InOutBuf,
4241
};
4342
use aes::Aes256;
4443
use aes_gcm::Aes256Gcm;
@@ -82,7 +81,9 @@ impl KeySizeUser for DndkGcm {
8281

8382
impl KeyInit for DndkGcm {
8483
fn new(key: &Key) -> Self {
85-
Self { aes: Aes256::new(key) }
84+
Self {
85+
aes: Aes256::new(key),
86+
}
8687
}
8788
}
8889

dndk-gcm/tests/dndkgcm.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ use dndk_gcm::DndkGcm;
1010
use hex_literal::hex;
1111

1212
/// DNDK-GCM test vectors (draft-gueron-cfrg-dndkgcm-03, Appendix A)
13-
const TEST_VECTORS_24: &[TestVector<[u8; 32], [u8; 24]>] = &[
14-
TestVector {
15-
key: &hex!("0100000000000000000000000000000000000000000000000000000000000000"),
16-
nonce: &hex!("000102030405060708090a0b0c0d0e0f1011121314151617"),
17-
plaintext: &hex!("11000001"),
18-
aad: &hex!("0100000011"),
19-
ciphertext: &hex!("7f6e39cc"),
20-
tag: &hex!("b61df0a502c167164e99fa23b7d12b9d"),
21-
},
22-
];
13+
const TEST_VECTORS_24: &[TestVector<[u8; 32], [u8; 24]>] = &[TestVector {
14+
key: &hex!("0100000000000000000000000000000000000000000000000000000000000000"),
15+
nonce: &hex!("000102030405060708090a0b0c0d0e0f1011121314151617"),
16+
plaintext: &hex!("11000001"),
17+
aad: &hex!("0100000011"),
18+
ciphertext: &hex!("7f6e39cc"),
19+
tag: &hex!("b61df0a502c167164e99fa23b7d12b9d"),
20+
}];
2321

2422
tests!(DndkGcm, TEST_VECTORS_24);

0 commit comments

Comments
 (0)