From a8216e28abe716ff0fc08556768b09a561507e3c Mon Sep 17 00:00:00 2001 From: Ronald Volgers Date: Sat, 13 Feb 2021 03:26:56 +0100 Subject: [PATCH] Clarify purpose of FromDigest trait --- ecdsa/src/hazmat.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ecdsa/src/hazmat.rs b/ecdsa/src/hazmat.rs index e93b4dd5..aa275f96 100644 --- a/ecdsa/src/hazmat.rs +++ b/ecdsa/src/hazmat.rs @@ -145,8 +145,12 @@ pub trait DigestPrimitive: Curve { /// Instantiate this type from the output of a digest. /// -/// This can be used for implementing hash-to-scalar (e.g. as in ECDSA) or -/// hash-to-curve algorithms. +/// This trait is intended for use in ECDSA and should perform a conversion +/// which is compatible with the rules for calculating `h` from `H(M)` set out +/// in RFC6979 section 2.4. This conversion cannot fail. +/// +/// This trait may also be useful for other hash-to-scalar or hash-to-curve +/// use cases. #[cfg(feature = "digest")] #[cfg_attr(docsrs, doc(cfg(feature = "digest")))] pub trait FromDigest {