pub struct FnDsaExpandedKey { /* private fields */ }Expand description
A precomputed Falcon signing tree for fast repeated signing.
Expanding a private key takes ~2.5× longer than a single sign operation,
but each subsequent sign/sign_deterministic call is ~1.5× faster
(no re-expansion). Use this when signing many messages with the same key.
The expanded key bytes are automatically zeroized on drop.
§Example
use falcon::prelude::*;
let kp = FnDsaKeyPair::generate(9).unwrap();
let ek = kp.expand().unwrap();
let sig = ek.sign(b"message", &DomainSeparation::None).unwrap();
FnDsaSignature::verify(sig.to_bytes(), ek.public_key(), b"message",
&DomainSeparation::None).unwrap();Implementations§
Source§impl FnDsaExpandedKey
impl FnDsaExpandedKey
Sourcepub fn sign(
&self,
message: &[u8],
domain: &DomainSeparation<'_>,
) -> Result<FnDsaSignature, FalconError>
pub fn sign( &self, message: &[u8], domain: &DomainSeparation<'_>, ) -> Result<FnDsaSignature, FalconError>
Sign a message using OS entropy.
Sourcepub fn sign_deterministic(
&self,
message: &[u8],
sign_seed: &[u8],
domain: &DomainSeparation<'_>,
) -> Result<FnDsaSignature, FalconError>
pub fn sign_deterministic( &self, message: &[u8], sign_seed: &[u8], domain: &DomainSeparation<'_>, ) -> Result<FnDsaSignature, FalconError>
Sign a message deterministically from a seed (for testing / no_std).
Sourcepub fn public_key(&self) -> &[u8] ⓘ
pub fn public_key(&self) -> &[u8] ⓘ
The public key corresponding to this expanded key.
Trait Implementations§
Source§impl Clone for FnDsaExpandedKey
impl Clone for FnDsaExpandedKey
Source§fn clone(&self) -> FnDsaExpandedKey
fn clone(&self) -> FnDsaExpandedKey
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 FnDsaExpandedKey
impl RefUnwindSafe for FnDsaExpandedKey
impl Send for FnDsaExpandedKey
impl Sync for FnDsaExpandedKey
impl Unpin for FnDsaExpandedKey
impl UnsafeUnpin for FnDsaExpandedKey
impl UnwindSafe for FnDsaExpandedKey
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