hash_utils 0.1.0

A collection of hash functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::Hasher;

pub struct Sm3;
impl Hasher for Sm3 {
    fn hash_name(&self) -> &'static str {
        "sm3"
    }
    fn active_bits(&self) -> &'static u32 {
        &256
    }
    fn hash(&self, data: &[u8]) -> Vec<u8> {
        use ::sm3::Digest;
        let mut hasher = ::sm3::Sm3::new();
        hasher.update(data);
        hasher.finalize().to_vec()
    }
}