diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/signature/src/hazmat.rs | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/signature/src/hazmat.rs')
-rw-r--r-- | vendor/signature/src/hazmat.rs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/vendor/signature/src/hazmat.rs b/vendor/signature/src/hazmat.rs index 8119225c6..d2f3e9523 100644 --- a/vendor/signature/src/hazmat.rs +++ b/vendor/signature/src/hazmat.rs @@ -5,18 +5,14 @@ //! //! Using them incorrectly can introduce security vulnerabilities. Please //! carefully read the documentation before attempting to use them. -//! -//! To use them, enable the `hazmat-preview` crate feature. Note that this -//! feature is semi-unstable and not subject to regular 1.x SemVer guarantees. -//! However, any breaking changes will be accompanied with a minor version bump. -use crate::{Error, Signature}; +use crate::Error; -#[cfg(feature = "rand-preview")] -use crate::rand_core::{CryptoRng, RngCore}; +#[cfg(feature = "rand_core")] +use crate::rand_core::CryptoRngCore; /// Sign the provided message prehash, returning a digital signature. -pub trait PrehashSigner<S: Signature> { +pub trait PrehashSigner<S> { /// Attempt to sign the given message digest, returning a digital signature /// on success, or an error if something went wrong. /// @@ -33,9 +29,8 @@ pub trait PrehashSigner<S: Signature> { } /// Sign the provided message prehash using the provided external randomness source, returning a digital signature. -#[cfg(feature = "rand-preview")] -#[cfg_attr(docsrs, doc(cfg(feature = "rand-preview")))] -pub trait RandomizedPrehashSigner<S: Signature> { +#[cfg(feature = "rand_core")] +pub trait RandomizedPrehashSigner<S> { /// Attempt to sign the given message digest, returning a digital signature /// on success, or an error if something went wrong. /// @@ -50,13 +45,13 @@ pub trait RandomizedPrehashSigner<S: Signature> { /// implementation to decide. fn sign_prehash_with_rng( &self, - rng: impl CryptoRng + RngCore, + rng: &mut impl CryptoRngCore, prehash: &[u8], ) -> Result<S, Error>; } /// Verify the provided message prehash using `Self` (e.g. a public key) -pub trait PrehashVerifier<S: Signature> { +pub trait PrehashVerifier<S> { /// Use `Self` to verify that the provided signature for a given message /// `prehash` is authentic. /// |