MCPcopy Create free account
hub / github.com/RustCrypto/utils / main

Function main

wycheproof2blb/src/main.rs:38–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38fn main() {
39 let args: Vec<String> = std::env::args().collect();
40 let wycheproof_dir = args
41 .get(1)
42 .expect("Provide directory with wycheproof vectors");
43 let algorithm = args.get(2).expect("Provide algorithm family");
44 let key_size = args
45 .get(3)
46 .expect("Provide key size in bits, or 0 for all sizes")
47 .parse::<u32>()
48 .expect("Key size needs to be a number of bits");
49 let out_path = args.get(4).expect("Provide path for output blobby file");
50 let descriptions_path = args.get(5).expect("Provide path for descriptions file");
51
52 let algo = match algorithm.as_str() {
53 "AES-GCM" => Algorithm {
54 file: "aes_gcm_test.json",
55 generator: aead::aes_gcm_generator,
56 },
57 "AES-GCM-SIV" => Algorithm {
58 file: "aes_gcm_siv_test.json",
59 generator: aead::aes_gcm_generator,
60 },
61 "CHACHA20-POLY1305" => Algorithm {
62 file: "chacha20_poly1305_test.json",
63 generator: aead::chacha20_poly1305,
64 },
65 "XCHACHA20-POLY1305" => Algorithm {
66 file: "xchacha20_poly1305_test.json",
67 generator: aead::xchacha20_poly1305,
68 },
69 "AES-SIV-CMAC" => Algorithm {
70 file: "aes_siv_cmac_test.json",
71 generator: aes_siv::generator,
72 },
73 "AES-CMAC" => Algorithm {
74 file: "aes_cmac_test.json",
75 generator: mac::generator,
76 },
77 "HKDF-SHA-1" => Algorithm {
78 file: "hkdf_sha1_test.json",
79 generator: hkdf::generator,
80 },
81 "HKDF-SHA-256" => Algorithm {
82 file: "hkdf_sha256_test.json",
83 generator: hkdf::generator,
84 },
85 "HKDF-SHA-384" => Algorithm {
86 file: "hkdf_sha384_test.json",
87 generator: hkdf::generator,
88 },
89 "HKDF-SHA-512" => Algorithm {
90 file: "hkdf_sha512_test.json",
91 generator: hkdf::generator,
92 },
93 "HMACSHA1" => Algorithm {
94 file: "hmac_sha1_test.json",
95 generator: mac::generator,

Callers

nothing calls this directly

Calls 6

dataFunction · 0.85
encode_blobsFunction · 0.85
expectMethod · 0.80
into_iterMethod · 0.80
getMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected