pub struct Signature { /* private fields */ }
Expand description
A BBS+ signature.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new(
messages: &[SignatureMessage],
signkey: &SecretKey,
verkey: &PublicKey,
) -> Result<Self, BBSError>
pub fn new( messages: &[SignatureMessage], signkey: &SecretKey, verkey: &PublicKey, ) -> Result<Self, BBSError>
No committed messages, All messages known to signer.
Sourcepub fn generate_blinding() -> SignatureBlinding
pub fn generate_blinding() -> SignatureBlinding
Generate the signature blinding factor that will be used to unblind the signature
Sourcepub fn verify(
&self,
messages: &[SignatureMessage],
verkey: &PublicKey,
) -> Result<bool, BBSError>
pub fn verify( &self, messages: &[SignatureMessage], verkey: &PublicKey, ) -> Result<bool, BBSError>
Verify a signature. During proof of knowledge also, this method is used after extending the verkey
Sourcepub fn validate(&self) -> Result<(), BBSError>
pub fn validate(&self) -> Result<(), BBSError>
Check if the signature is a valid form i.e. not infinity since it will always validate if that is the case
Sourcepub fn to_bytes_compressed_form(&self) -> [u8; 112]
pub fn to_bytes_compressed_form(&self) -> [u8; 112]
Convert to raw bytes form
Sourcepub fn to_bytes_uncompressed_form(&self) -> [u8; 160]
pub fn to_bytes_uncompressed_form(&self) -> [u8; 160]
Convert to raw bytes form
Trait Implementations§
Source§impl<'a> Deserialize<'a> for Signature
impl<'a> Deserialize<'a> for Signature
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more
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 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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more