From f14e3a3f218b4c6dbe13b8af076d30ba35770871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sun, 11 Jul 2021 02:32:36 +0300 Subject: [PATCH] re-export rand_core --- aead/CHANGELOG.md | 6 ++++++ cipher/CHANGELOG.md | 6 ++++++ cipher/Cargo.toml | 3 ++- cipher/src/lib.rs | 4 ++++ crypto-mac/CHANGELOG.md | 6 ++++++ crypto-mac/Cargo.toml | 2 +- crypto-mac/src/lib.rs | 4 ++++ elliptic-curve/CHANGELOG.md | 6 ++++++ elliptic-curve/Cargo.toml | 2 +- elliptic-curve/src/lib.rs | 4 ++++ password-hash/CHANGELOG.md | 6 ++++++ password-hash/Cargo.toml | 2 +- password-hash/src/lib.rs | 4 ++++ signature/CHANGELOG.md | 7 +++++++ signature/src/lib.rs | 21 ++++++++++++++++++++- 15 files changed, 78 insertions(+), 5 deletions(-) diff --git a/aead/CHANGELOG.md b/aead/CHANGELOG.md index 90e7e925b..ca9ceeb37 100644 --- a/aead/CHANGELOG.md +++ b/aead/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- Re-export `rand_core` ([#682]) + +[#682]: https://github.com/RustCrypto/traits/pull/682 + ## 0.4.1 (2021-05-03) ### Changed - Bump `heapless` dependency to v0.7 ([#628]) diff --git a/cipher/CHANGELOG.md b/cipher/CHANGELOG.md index 63af8392d..77b955f1f 100644 --- a/cipher/CHANGELOG.md +++ b/cipher/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- Re-export `rand_core` ([#683]) + +[#683]: https://github.com/RustCrypto/traits/pull/683 + ## 0.3.0 (2021-04-28) ### Added - Encrypt/decrypt-only block cipher traits ([#352]) diff --git a/cipher/Cargo.toml b/cipher/Cargo.toml index 803b017eb..017e3c028 100644 --- a/cipher/Cargo.toml +++ b/cipher/Cargo.toml @@ -15,13 +15,14 @@ categories = ["cryptography", "no-std"] generic-array = "0.14" crypto-common = { version = "=0.1.0-pre", path = "../crypto-common" } +# optional dependencies block-buffer = { version = "=0.10.0-pre.4", features = ["block-padding"], optional = true } blobby = { version = "0.3", optional = true } rand_core = { version = "0.6", optional = true } [features] default = ["mode_wrapper"] -std = ["crypto-common/std"] +std = ["crypto-common/std", "rand_core/std"] mode_wrapper = ["block-buffer"] dev = ["blobby"] diff --git a/cipher/src/lib.rs b/cipher/src/lib.rs index da2951d87..4a9a3ebe1 100644 --- a/cipher/src/lib.rs +++ b/cipher/src/lib.rs @@ -16,6 +16,10 @@ #[cfg(feature = "std")] extern crate std; +#[cfg(feature = "rand_core")] +#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))] +pub use rand_core; + #[cfg(feature = "dev")] pub use blobby; diff --git a/crypto-mac/CHANGELOG.md b/crypto-mac/CHANGELOG.md index 874f5ae88..95b1b7beb 100644 --- a/crypto-mac/CHANGELOG.md +++ b/crypto-mac/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- Re-export `rand_core` ([#683]) + +[#683]: https://github.com/RustCrypto/traits/pull/683 + ## 0.11.0 (2021-04-28) ### Added - `generate_key` method to `New*` trait ([#513]) diff --git a/crypto-mac/Cargo.toml b/crypto-mac/Cargo.toml index 259c6bdb2..414951a82 100644 --- a/crypto-mac/Cargo.toml +++ b/crypto-mac/Cargo.toml @@ -23,7 +23,7 @@ rand_core = { version = "0.6", optional = true } [features] dev = ["blobby"] core-api = ["crypto-common/core-api"] -std = ["crypto-common/std"] +std = ["crypto-common/std", "rand_core/std"] [package.metadata.docs.rs] all-features = true diff --git a/crypto-mac/src/lib.rs b/crypto-mac/src/lib.rs index 5020bc7a9..1bcf13f9b 100644 --- a/crypto-mac/src/lib.rs +++ b/crypto-mac/src/lib.rs @@ -12,6 +12,10 @@ #[cfg(feature = "std")] extern crate std; +#[cfg(feature = "rand_core")] +#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))] +pub use rand_core; + #[cfg(feature = "cipher")] pub use cipher; #[cfg(feature = "cipher")] diff --git a/elliptic-curve/CHANGELOG.md b/elliptic-curve/CHANGELOG.md index 4b9aea09f..124cd9015 100644 --- a/elliptic-curve/CHANGELOG.md +++ b/elliptic-curve/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- Re-export `rand_core` ([#683]) + +[#683]: https://github.com/RustCrypto/traits/pull/683 + ## 0.10.3 (2021-06-21) ### Changed - Bump `crypto-bigint` to v0.2.1 ([#673]) diff --git a/elliptic-curve/Cargo.toml b/elliptic-curve/Cargo.toml index c1cdd7a99..8788d9d32 100644 --- a/elliptic-curve/Cargo.toml +++ b/elliptic-curve/Cargo.toml @@ -43,7 +43,7 @@ ecdh = ["arithmetic", "zeroize"] hazmat = [] jwk = ["alloc", "base64ct/alloc", "serde", "serde_json", "zeroize/alloc"] pem = ["alloc", "pkcs8/pem"] -std = ["alloc"] +std = ["alloc", "rand_core/std"] [package.metadata.docs.rs] features = ["arithmetic", "ecdh", "jwk", "pem", "std"] diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 4bd36bc2b..244fdfe6c 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -27,6 +27,10 @@ extern crate alloc; #[cfg(feature = "std")] extern crate std; +#[cfg(feature = "rand_core")] +#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))] +pub use rand_core; + pub mod ops; pub mod sec1; pub mod weierstrass; diff --git a/password-hash/CHANGELOG.md b/password-hash/CHANGELOG.md index edf13dc96..e7994b0d3 100644 --- a/password-hash/CHANGELOG.md +++ b/password-hash/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- Re-export `rand_core` ([#683]) + +[#683]: https://github.com/RustCrypto/traits/pull/683 + ## 0.2.1 (2021-05-05) ### Changed - Use `subtle` crate for comparing hash `Output` ([#631]) diff --git a/password-hash/Cargo.toml b/password-hash/Cargo.toml index ac64a9e70..cf2c972b2 100644 --- a/password-hash/Cargo.toml +++ b/password-hash/Cargo.toml @@ -25,7 +25,7 @@ rand_core = { version = "0.6", optional = true, default-features = false } [features] default = ["rand_core"] alloc = ["base64ct/alloc"] -std = ["alloc", "base64ct/std"] +std = ["alloc", "base64ct/std", "rand_core/std"] [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] diff --git a/password-hash/src/lib.rs b/password-hash/src/lib.rs index 1083415b4..73cd21b14 100644 --- a/password-hash/src/lib.rs +++ b/password-hash/src/lib.rs @@ -50,6 +50,10 @@ extern crate alloc; #[cfg(feature = "std")] extern crate std; +#[cfg(feature = "rand_core")] +#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))] +pub use rand_core; + mod encoding; mod errors; mod ident; diff --git a/signature/CHANGELOG.md b/signature/CHANGELOG.md index baa3e4768..847134ef8 100644 --- a/signature/CHANGELOG.md +++ b/signature/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- Re-export `rand_core`. Emit compilation error if unstable functionality +is enabled by bypassing the preview features. ([#683]) + +[#683]: https://github.com/RustCrypto/traits/pull/683 + ## 1.3.1 (2021-06-29) ### Added - `Result` alias ([#676]) diff --git a/signature/src/lib.rs b/signature/src/lib.rs index 92f99f54f..a65f31b58 100644 --- a/signature/src/lib.rs +++ b/signature/src/lib.rs @@ -168,6 +168,24 @@ #[cfg(feature = "std")] extern crate std; +#[cfg(all(feature = "signature_derive", not(feature = "derive-preview")))] +compile_error!( + "The `signature_derive` feature should not be enabled directly. \ + Use the `derive-preview` feature instead." +); + +#[cfg(all(feature = "digest", not(feature = "digest-preview")))] +compile_error!( + "The `digest` feature should not be enabled directly. \ + Use the `digest-preview` feature instead." +); + +#[cfg(all(feature = "rand_core", not(feature = "rand-preview")))] +compile_error!( + "The `rand_core` feature should not be enabled directly. \ + Use the `rand-preview` feature instead." +); + #[cfg(feature = "derive-preview")] #[cfg_attr(docsrs, doc(cfg(feature = "derive-preview")))] pub use signature_derive::{Signer, Verifier}; @@ -175,7 +193,8 @@ pub use signature_derive::{Signer, Verifier}; #[cfg(feature = "digest-preview")] pub use digest; -#[cfg(feature = "rand-preview")] +#[cfg(feature = "rand_core")] +#[cfg_attr(docsrs, doc(cfg(feature = "rand-preview")))] pub use rand_core; mod error;