Struct frost_core::frost::Identifier
source · 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 serialize(&self) -> <<C::Group as Group>::Field as Field>::Serialization
pub fn serialize(&self) -> <<C::Group as Group>::Field as Field>::Serialization
Serialize the identifier using the ciphersuite encoding.
sourcepub fn deserialize(
buf: &<<C::Group as Group>::Field as Field>::Serialization
) -> Result<Self, Error<C>>
pub fn deserialize( buf: &<<C::Group as Group>::Field as Field>::Serialization ) -> 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 moresource§impl<C> Debug for Identifier<C>where
C: Ciphersuite,
impl<C> Debug for Identifier<C>where C: Ciphersuite,
source§impl<'de, C> Deserialize<'de> for Identifier<C>where
C: Deserialize<'de> + Ciphersuite,
impl<'de, C> Deserialize<'de> for Identifier<C>where C: Deserialize<'de> + 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>,
source§impl<C> Hash for Identifier<C>where
C: Ciphersuite,
impl<C> Hash for Identifier<C>where C: Ciphersuite,
source§impl<C> Mul<<<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar> for Identifier<C>where
C: Ciphersuite,
impl<C> Mul<<<<C as Ciphersuite>::Group as Group>::Field as Field>::Scalar> for Identifier<C>where C: Ciphersuite,
source§impl<C> MulAssign<Identifier<C>> for Scalar<C>where
C: Ciphersuite,
impl<C> MulAssign<Identifier<C>> for Scalar<C>where C: Ciphersuite,
source§fn mul_assign(&mut self, identifier: Identifier<C>)
fn mul_assign(&mut self, identifier: Identifier<C>)
*=
operation. Read moresource§impl<C> Ord for Identifier<C>where
C: Ciphersuite,
impl<C> Ord for Identifier<C>where C: Ciphersuite,
source§impl<C: PartialEq + Ciphersuite> PartialEq<Identifier<C>> for Identifier<C>
impl<C: PartialEq + Ciphersuite> PartialEq<Identifier<C>> for Identifier<C>
source§fn eq(&self, other: &Identifier<C>) -> bool
fn eq(&self, other: &Identifier<C>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<C> PartialOrd<Identifier<C>> for Identifier<C>where
C: Ciphersuite,
impl<C> PartialOrd<Identifier<C>> for Identifier<C>where C: Ciphersuite,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<C> Serialize for Identifier<C>where
C: Serialize + Ciphersuite,
impl<C> Serialize for Identifier<C>where C: Serialize + Ciphersuite,
source§impl<C> Sub<Identifier<C>> for Identifier<C>where
C: Ciphersuite,
impl<C> Sub<Identifier<C>> for Identifier<C>where C: Ciphersuite,
§type Output = Identifier<C>
type Output = Identifier<C>
-
operator.