Struct parity_crypto::publickey::Signature
source · [−]#[repr(C)]pub struct Signature(_);
Expand description
Signature encoded as RSV components
Implementations
sourceimpl Signature
impl Signature
sourcepub fn r(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn r(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Get a slice into the ‘r’ portion of the data.
sourcepub fn s(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn s(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Get a slice into the ‘s’ portion of the data.
sourcepub fn into_electrum(self) -> [u8; 65]
pub fn into_electrum(self) -> [u8; 65]
Encode the signature into RSV array (V altered to be in “Electrum” notation).
sourcepub fn from_electrum(data: &[u8]) -> Self
pub fn from_electrum(data: &[u8]) -> Self
Parse bytes as a signature encoded as RSV (V in “Electrum” notation). May return empty (invalid) signature if given data has invalid length.
sourcepub fn from_rsv(r: &H256, s: &H256, v: u8) -> Self
pub fn from_rsv(r: &H256, s: &H256, v: u8) -> Self
Create a signature object from the RSV triple.
sourcepub fn is_low_s(&self) -> bool
pub fn is_low_s(&self) -> bool
Check if this is a “low” signature (that s part of the signature is in range 0x1 and 0x7FFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 5D576E73 57A4501D DFE92F46 681B20A0 (inclusive)). This condition may be required by some verification algorithms
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Check if each component of the signature is in valid range. r is in range 0x1 and 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 (inclusive) s is in range 0x1 and fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 (inclusive) v is 0 or 1 Group order for secp256k1 defined as ‘n’ in “Standards for Efficient Cryptography” (SEC2) 2.7.1; used here as the upper bound for a valid (r, s, v) tuple
Trait Implementations
impl Eq for Signature
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more