Struct Message
pub struct Message(/* private fields */);
Expand description
A (hashed) message input to an ECDSA signature.
Implementations§
§impl Message
impl Message
pub fn from_slice(digest: &[u8]) -> Result<Message, Error>
👎Deprecated since 0.28.0: use from_digest_slice instead
pub fn from_slice(digest: &[u8]) -> Result<Message, Error>
Creates a Message
from a 32 byte slice digest
.
Converts a MESSAGE_SIZE
-byte slice to a message object. WARNING: the slice has to be a
cryptographically secure hash of the actual message that’s going to be signed. Otherwise
the result of signing isn’t a
secure signature.
pub fn from_digest(digest: [u8; 32]) -> Message
pub fn from_digest(digest: [u8; 32]) -> Message
Creates a Message
from a digest
.
The digest
array has to be a cryptographically secure hash of the actual message that’s
going to be signed. Otherwise the result of signing isn’t a secure signature.
pub fn from_digest_slice(digest: &[u8]) -> Result<Message, Error>
pub fn from_digest_slice(digest: &[u8]) -> Result<Message, Error>
Creates a Message
from a 32 byte slice digest
.
The slice has to be 32 bytes long and be a cryptographically secure hash of the actual message that’s going to be signed. Otherwise the result of signing isn’t a secure signature.
§Errors
If digest
is not exactly 32 bytes long.