pub struct Message(/* private fields */);
Expand description
A (hashed) message input to an ECDSA signature.
Implementations§
source§impl Message
impl Message
sourcepub 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>
If you just want to sign an arbitrary message use Message::from_hashed_data
instead.
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.
sourcepub fn from_digest(digest: [u8; 32]) -> Message
pub fn from_digest(digest: [u8; 32]) -> Message
Creates a Message
from a digest
.
If you just want to sign an arbitrary message use Message::from_hashed_data
instead.
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.
sourcepub 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
.
If you just want to sign an arbitrary message use Message::from_hashed_data
instead.
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.
Trait Implementations§
source§impl<T: ThirtyTwoByteHash> From<T> for Message
impl<T: ThirtyTwoByteHash> From<T> for Message
source§impl Ord for Message
impl Ord for Message
source§impl PartialEq for Message
impl PartialEq for Message
source§impl PartialOrd for Message
impl PartialOrd for Message
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Message
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)