Skip to content

Commit

Permalink
kbkdf: std is no longer required as core::error::Error stabilized (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo authored Jan 29, 2025
1 parent 289c98e commit 737aaa0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 43 deletions.
28 changes: 0 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions kbkdf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ sha1 = { version = "0.11.0-pre.2", default-features = false }
cmac = "0.8.0-pre.2"
aes = "0.9.0-pre.2"

[features]
std = ["hmac/std"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
13 changes: 1 addition & 12 deletions kbkdf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(feature = "std")]
extern crate std;

use core::{fmt, marker::PhantomData, ops::Mul};
use digest::{
array::{typenum::Unsigned, Array, ArraySize},
Expand All @@ -24,7 +21,6 @@ pub mod sealed;

#[derive(Debug, PartialEq)]
pub enum Error {
// TODO(baloo): we can probably move that to a compilation error via use of typenum
InvalidRequestSize,
}

Expand All @@ -39,13 +35,7 @@ impl fmt::Display for Error {
}
}

#[cfg(feature = "std")]
mod std_error {
use super::Error;
use std::error;

impl error::Error for Error {}
}
impl core::error::Error for Error {}

// Helper structure along with [`KbkdfUser`] to compute values of L and H.
struct KbkdfCore<OutputLen, PrfOutputLen> {
Expand Down Expand Up @@ -92,7 +82,6 @@ where
/// Derives `key` from `kin` and other parameters.
fn derive(
&self,
//kin: &GenericArray<u8, Prf::KeySize>,
kin: &[u8],
use_l: bool,
use_separator: bool,
Expand Down

0 comments on commit 737aaa0

Please sign in to comment.