Fix doc for CryptoStore::ecdsa_sign_prehashed() (#8876)

* fix ecdsa_sign_prehashed() doc

* document both instances
This commit is contained in:
Andreas Doerr
2021-05-21 09:52:20 +02:00
committed by GitHub
parent 39a7decd1c
commit a183031eef
2 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -336,7 +336,7 @@ impl From<LogLevel> for log::Level {
/// Log level filter that expresses which log levels should be filtered. /// Log level filter that expresses which log levels should be filtered.
/// ///
/// This enum matches the [`log::LogLevelFilter`] enum. /// This enum matches the [`log::LevelFilter`] enum.
#[derive(Encode, Decode, PassByEnum, Copy, Clone)] #[derive(Encode, Decode, PassByEnum, Copy, Clone)]
pub enum LogLevelFilter { pub enum LogLevelFilter {
/// `Off` log level filter. /// `Off` log level filter.
+20 -10
View File
@@ -195,13 +195,18 @@ pub trait CryptoStore: Send + Sync {
transcript_data: VRFTranscriptData, transcript_data: VRFTranscriptData,
) -> Result<Option<VRFSignature>, Error>; ) -> Result<Option<VRFSignature>, Error>;
/// Sign pre-hashed /// Generate an ECDSA signature for a given pre-hashed message.
/// ///
/// Signs a pre-hashed message with the private key that matches /// Receives [`KeyTypeId`] and an [`ecdsa::Public`] key to be able to map
/// the ECDSA public key passed. /// them to a private key that exists in the keystore. This private key is,
/// in turn, used for signing the provided pre-hashed message.
/// ///
/// Returns the SCALE encoded signature if key is found and supported, /// The `msg` argument provided should be a hashed message for which an
/// `None` if the key doesn't exist or an error when something failed. /// ECDSA signature should be generated.
///
/// Returns an [`ecdsa::Signature`] or `None` in case the given `id` and
/// `public` combination doesn't exist in the keystore. An `Err` will be
/// returned if generating the signature itself failed.
async fn ecdsa_sign_prehashed( async fn ecdsa_sign_prehashed(
&self, &self,
id: KeyTypeId, id: KeyTypeId,
@@ -368,13 +373,18 @@ pub trait SyncCryptoStore: CryptoStore + Send + Sync {
transcript_data: VRFTranscriptData, transcript_data: VRFTranscriptData,
) -> Result<Option<VRFSignature>, Error>; ) -> Result<Option<VRFSignature>, Error>;
/// Sign pre-hashed /// Generate an ECDSA signature for a given pre-hashed message.
/// ///
/// Signs a pre-hashed message with the private key that matches /// Receives [`KeyTypeId`] and an [`ecdsa::Public`] key to be able to map
/// the ECDSA public key passed. /// them to a private key that exists in the keystore. This private key is,
/// in turn, used for signing the provided pre-hashed message.
/// ///
/// Returns the SCALE encoded signature if key is found and supported, /// The `msg` argument provided should be a hashed message for which an
/// `None` if the key doesn't exist or an error when something failed. /// ECDSA signature should be generated.
///
/// Returns an [`ecdsa::Signature`] or `None` in case the given `id` and
/// `public` combination doesn't exist in the keystore. An `Err` will be
/// returned if generating the signature itself failed.
fn ecdsa_sign_prehashed( fn ecdsa_sign_prehashed(
&self, &self,
id: KeyTypeId, id: KeyTypeId,