File: mod.rs

package info (click to toggle)
rust-sm3 0.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 132 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 392 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use digest::dev::{feed_rand_16mib, fixed_reset_test};
use digest::new_test;
use hex_literal::hex;
use sm3::{Digest, Sm3};

new_test!(sm3_main, "sm3", Sm3, fixed_reset_test);

#[test]
fn sm3_rand() {
    let mut h = Sm3::new();
    feed_rand_16mib(&mut h);
    assert_eq!(
        h.finalize()[..],
        hex!("ad154967b08d636a148dd4c688a6df7add1ed1946af18eb358a9b320de2aca86")[..]
    );
}