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 ::blake2::Blake2bVarCore;
use ::blake2::digest::{Update, VariableOutput};
use blake2::digest::core_api::RtVariableCoreWrapper;
use blake2::Blake2bVar;
pub struct BLAKE256 {
hash: BITS256,
hasher: RtVariableCoreWrapper<Blake2bVarCore>,
hasher: Blake2bVar,
}
impl Hasher for BLAKE256 {

View File

@@ -1,11 +1,9 @@
use super::*;
use ::blake2::Blake2bVarCore;
use ::blake2::digest::{Update, VariableOutput};
use blake2::digest::core_api::RtVariableCoreWrapper;
use blake2::{Blake2b512, Digest};
pub struct BLAKE512 {
hash: BITS512,
hasher: RtVariableCoreWrapper<Blake2bVarCore>,
hasher: Blake2b512,
}
impl Hasher for BLAKE512 {
@@ -14,7 +12,7 @@ impl Hasher for BLAKE512 {
hash: [0; 64],
// 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
hasher: ::blake2::Blake2bVar::new(64).unwrap(),
hasher: ::blake2::Blake2b512::new(),
}
}
@@ -23,7 +21,7 @@ impl Hasher for BLAKE512 {
}
fn complete(mut self) -> HashReturn {
let res = self.hasher.finalize_boxed();
let res = self.hasher.finalize();
self.hash.copy_from_slice(&res);
HashReturn::BLAKE512(self.hash)
}

View File

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

View File

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