pub struct Randomizer<C: Ciphersuite>(/* private fields */);
Expand description
A randomizer. A random scalar which is used to randomize the key.
Implementations§
Source§impl<C> Randomizer<C>where
C: RandomizedCiphersuite,
impl<C> Randomizer<C>where
C: RandomizedCiphersuite,
Sourcepub fn new<R: RngCore + CryptoRng>(
rng: R,
signing_package: &SigningPackage<C>,
) -> Result<Self, Error<C>>
pub fn new<R: RngCore + CryptoRng>( rng: R, signing_package: &SigningPackage<C>, ) -> Result<Self, Error<C>>
Create a new random Randomizer.
The SigningPackage
must be the signing package being used in the
current FROST signing run. It is hashed into the randomizer calculation,
which binds it to that specific package.
Source§impl<C> Randomizer<C>where
C: Ciphersuite,
impl<C> Randomizer<C>where
C: Ciphersuite,
Sourcepub fn from_scalar(scalar: Scalar<C>) -> Self
pub fn from_scalar(scalar: Scalar<C>) -> Self
Create a new Randomizer from the given scalar. It MUST be randomly generated.
It is not recommended to use this method unless for compatibility
reasons with specifications on how the randomizer must be generated. Use
Randomizer::new()
instead.
Sourcepub fn deserialize(buf: &[u8]) -> Result<Self, Error<C>>
pub fn deserialize(buf: &[u8]) -> Result<Self, Error<C>>
Deserialize an Identifier from a serialized buffer. Returns an error if it attempts to deserialize zero.
Trait Implementations§
Source§impl<C: Clone + Ciphersuite> Clone for Randomizer<C>
impl<C: Clone + Ciphersuite> Clone for Randomizer<C>
Source§fn clone(&self) -> Randomizer<C>
fn clone(&self) -> Randomizer<C>
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 moreSource§impl<C> Debug for Randomizer<C>where
C: Ciphersuite,
impl<C> Debug for Randomizer<C>where
C: Ciphersuite,
Source§impl<'de, C> Deserialize<'de> for Randomizer<C>where
C: Ciphersuite,
impl<'de, C> Deserialize<'de> for Randomizer<C>where
C: Ciphersuite,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<C: PartialEq + Ciphersuite> PartialEq for Randomizer<C>
impl<C: PartialEq + Ciphersuite> PartialEq for Randomizer<C>
Source§impl<C> Serialize for Randomizer<C>where
C: Ciphersuite,
impl<C> Serialize for Randomizer<C>where
C: Ciphersuite,
impl<C: Copy + Ciphersuite> Copy for Randomizer<C>
impl<C: Eq + Ciphersuite> Eq for Randomizer<C>
impl<C: Ciphersuite> StructuralPartialEq for Randomizer<C>
Auto Trait Implementations§
impl<C> Freeze for Randomizer<C>
impl<C> RefUnwindSafe for Randomizer<C>
impl<C> Send for Randomizer<C>
impl<C> Sync for Randomizer<C>
impl<C> Unpin for Randomizer<C>
impl<C> UnwindSafe for Randomizer<C>
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