libmilkyway 0.1.0

libmilkyway is a part of milkyway project providing common protocols for communicating between MilkyWay modules
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::pki::hash::{CryptoHashable, Hash, HashType};
use crate::serialization::serializable::Serializable;

impl<T> CryptoHashable for T where T: Serializable{
    fn crypto_hash(&self, hash_type: HashType) -> Hash {
        match hash_type {
            HashType::None => {
                Hash {
                    algorithm: HashType::None,
                    hash: vec![0],
                }
            }
            HashType::SHA512 => { todo!() }
        }
    }
}