From 737aaa08ace2b4560bb070859517894479204c1b Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Wed, 29 Jan 2025 09:13:06 -0800 Subject: [PATCH] kbkdf: std is no longer required as core::error::Error stabilized (#2) --- Cargo.lock | 28 ---------------------------- kbkdf/Cargo.toml | 3 --- kbkdf/src/lib.rs | 13 +------------ 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4176635..07ea7c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,9 +112,7 @@ version = "0.2.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" dependencies = [ - "getrandom", "hybrid-array", - "rand_core", ] [[package]] @@ -137,17 +135,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "hex" version = "0.4.3" @@ -218,15 +205,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - [[package]] name = "sha1" version = "0.11.0-pre.4" @@ -260,9 +238,3 @@ name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/kbkdf/Cargo.toml b/kbkdf/Cargo.toml index b021c2f..4ca035c 100644 --- a/kbkdf/Cargo.toml +++ b/kbkdf/Cargo.toml @@ -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"] diff --git a/kbkdf/src/lib.rs b/kbkdf/src/lib.rs index cd5cceb..87a7d95 100644 --- a/kbkdf/src/lib.rs +++ b/kbkdf/src/lib.rs @@ -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}, @@ -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, } @@ -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 { @@ -92,7 +82,6 @@ where /// Derives `key` from `kin` and other parameters. fn derive( &self, - //kin: &GenericArray, kin: &[u8], use_l: bool, use_separator: bool,