From da7dad6f1c85bdcadc9a9b81c33f2a161eb429b8 Mon Sep 17 00:00:00 2001 From: Harshil Jani Date: Sun, 25 Jun 2023 16:03:34 +0530 Subject: [PATCH] Improving Message struct description Signed-off-by: Harshil Jani --- src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 14d65f224..76b6da3cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -211,7 +211,13 @@ impl ThirtyTwoByteHash for hashes::sha256t::Hash { fn into_32(self) -> [u8; 32] { self.to_byte_array() } } -/// A (hashed) message input to an ECDSA signature. +/// A (hashed) message input to an EC signature algorithm (such as ECDSA or Schnorr). +/// +/// Message is invalid if +/// - Message has no content or has a length of zero. +/// - Message length doesn't match the expected size. +/// - Non hased message is passed as input. +/// #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Message([u8; constants::MESSAGE_SIZE]); impl_array_newtype!(Message, u8, constants::MESSAGE_SIZE);