Enum bc_components::Signature
source · pub enum Signature {
Schnorr {
sig: [u8; 64],
tag: Vec<u8>,
},
ECDSA([u8; 64]),
}
Expand description
A cryptographic signature. Supports ECDSA and Schnorr.
Variants§
Implementations§
source§impl Signature
impl Signature
sourcepub fn schnorr_from_data<D>(data: [u8; 64], tag: D) -> Selfwhere
D: Into<Vec<u8>>,
pub fn schnorr_from_data<D>(data: [u8; 64], tag: D) -> Selfwhere D: Into<Vec<u8>>,
Restores a Schnorr signature from a vector of bytes.
sourcepub fn schnorr_from_data_ref<D1, D2>(data: D1, tag: D2) -> Option<Self>where
D1: AsRef<[u8]>,
D2: AsRef<[u8]>,
pub fn schnorr_from_data_ref<D1, D2>(data: D1, tag: D2) -> Option<Self>where D1: AsRef<[u8]>, D2: AsRef<[u8]>,
Restores a Schnorr signature from a vector of bytes.
sourcepub fn ecdsa_from_data(data: [u8; 64]) -> Self
pub fn ecdsa_from_data(data: [u8; 64]) -> Self
Restores an ECDSA signature from a vector of bytes.
sourcepub fn ecdsa_from_data_ref<D>(data: D) -> Option<Self>where
D: AsRef<[u8]>,
pub fn ecdsa_from_data_ref<D>(data: D) -> Option<Self>where D: AsRef<[u8]>,
Restores an ECDSA signature from a vector of bytes.
Trait Implementations§
source§impl CBORDecodable for Signature
impl CBORDecodable for Signature
source§impl CBOREncodable for Signature
impl CBOREncodable for Signature
source§impl CBORTagged for Signature
impl CBORTagged for Signature
source§impl CBORTaggedDecodable for Signature
impl CBORTaggedDecodable for Signature
source§fn from_untagged_cbor(cbor: &CBOR) -> Result<Self, Error>
fn from_untagged_cbor(cbor: &CBOR) -> Result<Self, Error>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
source§impl CBORTaggedEncodable for Signature
impl CBORTaggedEncodable for Signature
source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
source§impl PartialEq<Signature> for Signature
impl PartialEq<Signature> for Signature
source§impl UREncodable for Signature
impl UREncodable for Signature
impl Eq for Signature
impl StructuralEq for Signature
impl StructuralPartialEq 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§
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