Skip to content

Commit f2d2e41

Browse files
authored
magma: fix rustfmt (#120)
It appears rustfmt strips all trailing comments: rust-lang/rustfmt#4028
1 parent d2696ac commit f2d2e41

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

magma/tests/lib.rs

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#![no_std]
2-
#![cfg_attr(rustfmt, rustfmt_skip)]
2+
33
use magma;
44

55
use block_cipher::generic_array::GenericArray;
66
use block_cipher::{BlockCipher, NewBlockCipher};
77

88
/// Example vectors from GOST 34.12-2018
99
#[test]
10+
#[rustfmt::skip]
1011
fn magma_test() {
1112
let key = [
1213
0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88,
@@ -30,30 +31,3 @@ fn magma_test() {
3031
state.decrypt_block(&mut block);
3132
assert_eq!(&plaintext, block.as_slice());
3233
}
33-
34-
/*
35-
// an attempt to test with vectors from
36-
// https://github.com/gost-engine/engine/blob/master/test/03-encrypt.t
37-
#[test]
38-
fn engine_test() {
39-
use block_modes::{BlockMode, Cbc, block_padding::Pkcs7};
40-
41-
type Cipher = Cbc<magma::Gost89CryptoProA, Pkcs7>;
42-
43-
let key: [u8; 32] = [
44-
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
45-
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
46-
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
47-
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
48-
];
49-
let iv: [u8; 8] = [0; 8];
50-
let plaintext = b"The quick brown fox jumps over the lazy dog\n";
51-
52-
let c = Cipher::new_var(&key, &iv).unwrap();
53-
let ct = c.encrypt_vec(plaintext);
54-
for b in ct {
55-
print!("0x{:02X}, ", b);
56-
}
57-
println!();
58-
}
59-
*/

0 commit comments

Comments
 (0)