Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo committed Oct 29, 2023
1 parent cb8284c commit 0a99489
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
3 changes: 1 addition & 2 deletions kbkdf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![recursion_limit = "128"]

#[cfg(feature = "std")]
extern crate std;
Expand Down Expand Up @@ -82,7 +81,7 @@ where
/// - K - the expected output length of the newly derived key
/// - R - An integer (1 <= r <= 32) that indicates the length of the binary encoding of the counter i
/// as an integer in the interval [1, 2r − 1].
pub trait Kbkdf<Prf, K, R: sealed::R = U32>
pub trait Kbkdf<Prf, K, R: sealed::R>
where
Prf: Mac + KeyInit,
K: KeySizeUser,
Expand Down
21 changes: 10 additions & 11 deletions kbkdf/src/sealed.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use digest::{
consts::{U16, U24, U32, U8},
generic_array::typenum::Unsigned,
};
use digest::{
consts::{U16, U24, U32, U8},
generic_array::typenum::Unsigned,
};

/// Marker used to register valid values for R in the KBKDF
pub trait R: Unsigned {}

impl R for U8 {}
impl R for U16 {}
impl R for U24 {}
impl R for U32 {}
/// Marker used to register valid values for R in the KBKDF
pub trait R: Unsigned {}

impl R for U8 {}
impl R for U16 {}
impl R for U24 {}
impl R for U32 {}

0 comments on commit 0a99489

Please sign in to comment.