pub struct FnDsaSignature { /* private fields */ }Expand description
An FN-DSA / HashFN-DSA digital signature.
Signature bytes are in constant-time (CT) format: 666 bytes for FN-DSA-512, 1280 bytes for FN-DSA-1024.
Implementations§
Source§impl FnDsaSignature
impl FnDsaSignature
Sourcepub fn from_bytes(data: Vec<u8>) -> Result<Self, FalconError>
pub fn from_bytes(data: Vec<u8>) -> Result<Self, FalconError>
Deserialize a signature from raw bytes.
Returns Err(FalconError::FormatError) if the bytes are too short
(minimum 41 bytes: 1 header + 40 nonce) or the header byte is invalid.
Sourcepub fn verify(
sig: &[u8],
pubkey: &[u8],
message: &[u8],
domain: &DomainSeparation<'_>,
) -> Result<(), FalconError>
pub fn verify( sig: &[u8], pubkey: &[u8], message: &[u8], domain: &DomainSeparation<'_>, ) -> Result<(), FalconError>
Verify a signature against pubkey and message.
The domain must exactly match what was used during signing
(same variant, same context string, same pre-hash algorithm).
Supports pure FN-DSA and HashFN-DSA transparently.
§Errors
FalconError::BadArgument— context string > 255 bytes.FalconError::BadSignature— signature is invalid.FalconError::FormatError— malformed key or signature.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume and return the owned byte vector.
Trait Implementations§
Source§impl Clone for FnDsaSignature
impl Clone for FnDsaSignature
Source§fn clone(&self) -> FnDsaSignature
fn clone(&self) -> FnDsaSignature
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FnDsaSignature
impl RefUnwindSafe for FnDsaSignature
impl Send for FnDsaSignature
impl Sync for FnDsaSignature
impl Unpin for FnDsaSignature
impl UnsafeUnpin for FnDsaSignature
impl UnwindSafe for FnDsaSignature
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