diff --git a/src/ecaps2.rs b/src/ecaps2.rs index e397a455..b69a6449 100644 --- a/src/ecaps2.rs +++ b/src/ecaps2.rs @@ -120,7 +120,6 @@ pub fn compute_disco(disco: &Disco) -> Vec { pub fn hash_ecaps2(data: &[u8], algo: Algo) -> Result { Ok(Hash { - algo: algo.clone(), hash: match algo { Algo::Sha_256 => { let mut hasher = Sha256::default(); @@ -163,6 +162,7 @@ pub fn hash_ecaps2(data: &[u8], algo: Algo) -> Result { Algo::Sha_1 => return Err(String::from("Disabled algorithm sha-1: unsafe.")), Algo::Unknown(algo) => return Err(format!("Unknown algorithm: {}.", algo)), }, + algo: algo, }) }