pub struct Nonce(/* private fields */);Expand description
Nonce of the Falcon signature.
Implementations§
Source§impl Nonce
impl Nonce
Sourcepub fn deterministic() -> Nonce
pub fn deterministic() -> Nonce
Returns a new deterministic Nonce.
This is used in deterministic signing following 1 and is composed of two parts:
- a byte serving as a version byte,
- a pre-versioned fixed nonce which is the UTF8 encoding of the domain separator “RPO-FALCON-DET” padded with enough zeros to make it of size 39 bytes.
The usefulness of the notion of versioned fixed nonce is discussed in Section 2.1 in 1.
Sourcepub fn from_bytes(nonce_bytes: [u8; 40]) -> Nonce
pub fn from_bytes(nonce_bytes: [u8; 40]) -> Nonce
Returns a Nonce given an array of bytes.
Sourcepub fn to_elements(&self) -> [BaseElement; 8]
pub fn to_elements(&self) -> [BaseElement; 8]
Converts byte representation of the nonce into field element representation.
Nonce bytes are converted to field elements by taking consecutive 5 byte chunks of the nonce and interpreting them as field elements.
Trait Implementations§
Source§impl Deserializable for Nonce
impl Deserializable for Nonce
Source§fn read_from<R>(source: &mut R) -> Result<Nonce, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<Nonce, DeserializationError>where
R: ByteReader,
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into Self, and returns the result. Read moreSource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl Serializable for &Nonce
impl Serializable for &Nonce
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Serializes
self into bytes and writes these bytes into the target.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl Eq for Nonce
impl StructuralPartialEq for Nonce
Auto Trait Implementations§
impl Freeze for Nonce
impl RefUnwindSafe for Nonce
impl Send for Nonce
impl Sync for Nonce
impl Unpin for Nonce
impl UnwindSafe for Nonce
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