pub struct Identifier<C: Ciphersuite>(/* private fields */);
Expand description
A FROST participant identifier.
The identifier is a field element in the scalar field that the secret polynomial is defined over, corresponding to some x-coordinate for a polynomial f(x) = y. MUST NOT be zero in the field, as f(0) = the shared secret.
Implementations§
Source§impl<C> Identifier<C>where
C: Ciphersuite,
impl<C> Identifier<C>where
C: Ciphersuite,
Sourcepub fn derive(s: &[u8]) -> Result<Self, Error<C>>
pub fn derive(s: &[u8]) -> Result<Self, Error<C>>
Derive an Identifier from an arbitrary byte string.
This feature is not part of the specification and is just a convenient way of creating identifiers.
Each possible byte string will map to an uniformly random identifier. Returns an error if the ciphersuite does not support identifier derivation, or if the mapped identifier is zero (which is unpredictable, but should happen with negligible probability).
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, Error<C>>
pub fn deserialize(bytes: &[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 Identifier<C>
impl<C: Clone + Ciphersuite> Clone for Identifier<C>
Source§fn clone(&self) -> Identifier<C>
fn clone(&self) -> Identifier<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more