use sha2::Digest; pub fn hash_bigint(n: usize, i: &num::BigInt) -> Vec { let (_, bytes) = i.to_bytes_be(); assert!(bytes.len() <= n); let mut hash = sha2::Sha512::new(); hash.input(vec![0; n - bytes.len()]); hash.input(bytes); hash.result().to_vec() } pub fn show_hash(h: &Vec) { for x in h { print!("{:02x}", x); } println!(); }