cleaned up inner types

This commit is contained in:
2025-08-18 20:17:43 -04:00
parent 1c5e2b347d
commit c5fb198bc6
4 changed files with 10 additions and 15 deletions

View File

@@ -1,11 +1,10 @@
use super::*; use super::*;
use ::blake2::Blake2bVarCore;
use ::blake2::digest::{Update, VariableOutput}; use ::blake2::digest::{Update, VariableOutput};
use blake2::digest::core_api::RtVariableCoreWrapper; use blake2::Blake2bVar;
pub struct BLAKE256 { pub struct BLAKE256 {
hash: BITS256, hash: BITS256,
hasher: RtVariableCoreWrapper<Blake2bVarCore>, hasher: Blake2bVar,
} }
impl Hasher for BLAKE256 { impl Hasher for BLAKE256 {

View File

@@ -1,11 +1,9 @@
use super::*; use super::*;
use ::blake2::Blake2bVarCore; use blake2::{Blake2b512, Digest};
use ::blake2::digest::{Update, VariableOutput};
use blake2::digest::core_api::RtVariableCoreWrapper;
pub struct BLAKE512 { pub struct BLAKE512 {
hash: BITS512, hash: BITS512,
hasher: RtVariableCoreWrapper<Blake2bVarCore>, hasher: Blake2b512,
} }
impl Hasher for BLAKE512 { impl Hasher for BLAKE512 {
@@ -14,7 +12,7 @@ impl Hasher for BLAKE512 {
hash: [0; 64], hash: [0; 64],
// Variable size was done instead of using Blake2b512 type alias as the concrete type // Variable size was done instead of using Blake2b512 type alias as the concrete type
// that would need to be defined in the struct BLAKE512 is silly // that would need to be defined in the struct BLAKE512 is silly
hasher: ::blake2::Blake2bVar::new(64).unwrap(), hasher: ::blake2::Blake2b512::new(),
} }
} }
@@ -23,7 +21,7 @@ impl Hasher for BLAKE512 {
} }
fn complete(mut self) -> HashReturn { fn complete(mut self) -> HashReturn {
let res = self.hasher.finalize_boxed(); let res = self.hasher.finalize();
self.hash.copy_from_slice(&res); self.hash.copy_from_slice(&res);
HashReturn::BLAKE512(self.hash) HashReturn::BLAKE512(self.hash)
} }

View File

@@ -1,10 +1,9 @@
use super::*; use super::*;
use ::md5::digest::core_api::CoreWrapper; use ::md5::{Digest, Md5};
use ::md5::{Digest, Md5, Md5Core};
pub struct MD5 { pub struct MD5 {
hash: BITS128, hash: BITS128,
hasher: CoreWrapper<Md5Core>, hasher: Md5,
} }
impl Hasher for MD5 { impl Hasher for MD5 {

View File

@@ -1,10 +1,9 @@
use super::*; use super::*;
use ::sha1::digest::core_api::CoreWrapper; use ::sha1::{Digest, Sha1};
use ::sha1::{Digest, Sha1, Sha1Core};
pub struct SHA1 { pub struct SHA1 {
hash: BITS160, hash: BITS160,
hasher: CoreWrapper<Sha1Core>, hasher: Sha1,
} }
impl Hasher for SHA1 { impl Hasher for SHA1 {