pub struct Falcon1024Signer { /* private fields */ }Expand description
Falcon-1024 signer (lattice-based, ~NIST level 5).
Implementations§
Source§impl Falcon1024Signer
impl Falcon1024Signer
Sourcepub fn from_seed(seed: &[u8; 32]) -> Result<Self, CryptoError>
pub fn from_seed(seed: &[u8; 32]) -> Result<Self, CryptoError>
Create a signer from a 32-byte seed.
Note: Falcon-1024 keygen is expensive (~100ms on first call; ~10ms on cached re-derivation).
Sourcepub fn from_keys(sk: FalconPrivateKey, pk: FalconPublicKey) -> Self
pub fn from_keys(sk: FalconPrivateKey, pk: FalconPublicKey) -> Self
Create from an existing private/public key pair.
Sourcepub fn sign(&self, message: &[u8]) -> Result<Vec<u8>, CryptoError>
pub fn sign(&self, message: &[u8]) -> Result<Vec<u8>, CryptoError>
Sign a message. Returns a ~1280-byte Falcon-1024 signature.
Sourcepub fn verify(&self, message: &[u8], signature: &[u8]) -> bool
pub fn verify(&self, message: &[u8], signature: &[u8]) -> bool
Verify a signature against this signer’s public key.
Sourcepub fn verify_with_pubkey(
pubkey: &[u8],
message: &[u8],
signature: &[u8],
) -> bool
pub fn verify_with_pubkey( pubkey: &[u8], message: &[u8], signature: &[u8], ) -> bool
Verify a signature against an arbitrary Falcon-1024 public key.
Sourcepub fn public_key_bytes(&self) -> Vec<u8> ⓘ
pub fn public_key_bytes(&self) -> Vec<u8> ⓘ
Get the 1793-byte Falcon-1024 public key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Falcon1024Signer
impl RefUnwindSafe for Falcon1024Signer
impl Send for Falcon1024Signer
impl Sync for Falcon1024Signer
impl Unpin for Falcon1024Signer
impl UnsafeUnpin for Falcon1024Signer
impl UnwindSafe for Falcon1024Signer
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> 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