Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/sha2/tests/mod.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / sha2 / tests / mod.rs` 35 lines ยท 1123 bytes Raw Blame History 1 use digest::dev::{feed_rand_16mib, fixed_reset_test}; 2 use digest::new_test; 3 use hex_literal::hex; 4 use sha2::{Digest, Sha224, Sha256, Sha384, Sha512, Sha512_224, Sha512_256}; 5 6 new_test!(sha224_main, "sha224", Sha224, fixed_reset_test); 7 new_test!(sha256_main, "sha256", Sha256, fixed_reset_test); 8 new_test!(sha512_224_main, "sha512_224", Sha512_224, fixed_reset_test); 9 new_test!(sha512_256_main, "sha512_256", Sha512_256, fixed_reset_test); 10 new_test!(sha384_main, "sha384", Sha384, fixed_reset_test); 11 new_test!(sha512_main, "sha512", Sha512, fixed_reset_test); 12 13 #[test] 14 fn sha256_rand() { 15 let mut h = Sha256::new(); 16 feed_rand_16mib(&mut h); 17 assert_eq!( 18 h.finalize()[..], 19 hex!("`45f51fead87328fe837a86f4f1ac0eb15116ab1473adc0423ef86c62eb2320c7`")[..] 20 ); 21 } 22 23 #[test] 24 #[rustfmt::skip] 25 fn sha512_rand() { 26 let mut h = Sha512::new(); 27 feed_rand_16mib(&mut h); 28 assert_eq!( 29 h.finalize()[..], 30 hex!(" 31 `9084d75a7c0721541d737b6171eb465dc9ba08a119a182a8508484aa27a176cd` 32 `e7c2103b108393eb024493ced4aac56be6f57222cac41b801f11494886264997` 33 ")[..] 34 ); 35 }