Trait coins_bip32::prelude::SigTrait[][src]

pub trait SigTrait: AsRef<[u8]> + Debug {
    pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;

    pub fn as_bytes(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
{ ... } }

Re-exported signer traits Trait impl’d by concrete types that represent digital signatures.

Signature types must (as mandated by the AsRef<[u8]> bound) be a thin wrapper around the “bag-of-bytes” serialized form of a signature which can be directly parsed from or written to the “wire”.

Inspiration for this approach comes from the Ed25519 signature system, which adopted it based on the observation that past signature systems were not prescriptive about how signatures should be represented on-the-wire, and that lead to a proliferation of different wire formats and confusion about which ones should be used.

The Signature trait aims to provide similar simplicity by minimizing the number of steps involved to obtain a serializable signature and ideally ensuring there is one signature type for any given signature system shared by all “provider” crates.

For signature systems which require a more advanced internal representation (e.g. involving decoded scalars or decompressed elliptic curve points) it’s recommended that “provider” libraries maintain their own internal signature type and use From bounds to provide automatic conversions.

Required methods

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>[src]

Parse a signature from its byte representation

Loading content...

Provided methods

pub fn as_bytes(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Borrow a byte slice representing the serialized form of this signature

Loading content...

Implementations on Foreign Types

impl<C> Signature for Signature<C> where
    C: Curve + CheckSignatureBytes,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

impl<C> Signature for Signature<C> where
    C: Curve,
    <C as Curve>::FieldSize: Add<<C as Curve>::FieldSize>,
    <C as Curve>::FieldSize: ArrayLength<u8>,
    <<<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output as Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>>::Output: ArrayLength<u8>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: Add<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>, 
[src]

pub fn from_bytes(bytes: &[u8]) -> Result<Signature<C>, Error>[src]

Parse an ASN.1 DER-encoded ECDSA signature from a byte slice

Loading content...

Implementors

impl Signature for coins_bip32::ecdsa::recoverable::Signature[src]

Loading content...