Skip to content

Commit 2bcd7bf

Browse files
committed
Adds support for max depth 0 for blake2b and fixes tests
1 parent 0ce1995 commit 2bcd7bf

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

blake2b/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,9 @@ impl Params {
287287
self
288288
}
289289

290-
/// From 1 (the default, meaning sequential) to 255 (meaning unlimited).
290+
/// From 0, through 1 (the default, meaning sequential) to 255 (meaning unlimited).
291291
#[inline]
292292
pub fn max_depth(&mut self, depth: u8) -> &mut Self {
293-
assert!(depth != 0, "Bad max depth: {}", depth);
294293
self.max_depth = depth;
295294
self
296295
}

blake2b/src/test.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ fn test_long_personal_panics() {
172172
}
173173

174174
#[test]
175-
#[should_panic]
176-
fn test_zero_max_depth_panics() {
175+
fn test_zero_max_depth_supported() {
177176
Params::new().max_depth(0);
178177
}
179178

blake2s/src/test.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ fn test_long_personal_panics() {
168168
}
169169

170170
#[test]
171-
#[should_panic]
172-
fn test_zero_max_depth_panics() {
171+
fn test_zero_max_depth_supported() {
173172
Params::new().max_depth(0);
174173
}
175174

0 commit comments

Comments
 (0)