Skip to content

Commit 7f3080b

Browse files
committed
fix block sizes for blake2 hashes
1 parent 526cc6e commit 7f3080b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

blake2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "blake2"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
authors = ["RustCrypto Developers"]
55
license = "MIT OR Apache-2.0"
66
description = "BLAKE2 hash functions"

blake2/src/blake2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
macro_rules! blake2_impl {
22
(
33
$state:ident, $fix_state:ident, $word:ident, $vec:ident, $bytes:ident,
4-
$R1:expr, $R2:expr, $R3:expr, $R4:expr, $IV:expr,
4+
$block_size:ident, $R1:expr, $R2:expr, $R3:expr, $R4:expr, $IV:expr,
55
$vardoc:expr, $doc:expr,
66
) => {
77

@@ -237,7 +237,7 @@ macro_rules! blake2_impl {
237237
}
238238

239239
impl BlockInput for $state {
240-
type BlockSize = $bytes;
240+
type BlockSize = $block_size;
241241
}
242242

243243
impl Input for $state {
@@ -291,7 +291,7 @@ macro_rules! blake2_impl {
291291
}
292292

293293
impl BlockInput for $fix_state {
294-
type BlockSize = $bytes;
294+
type BlockSize = $block_size;
295295
}
296296

297297
impl Input for $fix_state {

blake2/src/blake2b.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use digest::generic_array::typenum::U64;
1+
use digest::generic_array::typenum::{U64, U128};
22
use consts::BLAKE2B_IV;
33

4-
blake2_impl!(VarBlake2b, Blake2b, u64, u64x4, U64,
4+
blake2_impl!(VarBlake2b, Blake2b, u64, u64x4, U64, U128,
55
32, 24, 16, 63, BLAKE2B_IV,
66
"Blake2b instance with a variable output.",
77
"Blake2b instance with a fixed output.",

blake2/src/blake2s.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use digest::generic_array::typenum::U32;
1+
use digest::generic_array::typenum::{U32, U64};
22
use consts::BLAKE2S_IV;
33

4-
blake2_impl!(VarBlake2s, Blake2s, u32, u32x4, U32,
4+
blake2_impl!(VarBlake2s, Blake2s, u32, u32x4, U32, U64,
55
16, 12, 8, 7, BLAKE2S_IV,
66
"Blake2s instance with a variable output.",
77
"Blake2s instance with a fixed output.",

0 commit comments

Comments
 (0)