pub struct Signature(pub(crate) Signature);Expand description
A secp256k1 ECDSA signature over SHA-256, in 64-byte compact r || s form.
Every value of this type that this crate produces is low-S; see the module docs.
Tuple Fields§
§0: SignatureImplementations§
Source§impl Signature
impl Signature
Sourcepub fn to_bytes(&self) -> [u8; 64]
pub fn to_bytes(&self) -> [u8; 64]
The 64-byte compact r || s encoding, which is what atproto puts in a
record’s sig field.
Sourcepub fn from_bytes(bytes: &[u8; 64]) -> Result<Self, KeyError>
pub fn from_bytes(bytes: &[u8; 64]) -> Result<Self, KeyError>
Parses a 64-byte compact r || s signature.
This accepts a high-S signature — rejecting malleability is
VerifyingKey::verify’s job, so that a signature from elsewhere can
be parsed and then be honestly reported as failing to verify.
Trait Implementations§
impl Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.