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 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: Ciphersuite,
impl<'de, C> Deserialize<'de> for Identifier<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>,
source§impl<C> Hash for Identifier<C>where
C: Ciphersuite,
impl<C> Hash for Identifier<C>where
C: Ciphersuite,
source§impl<C> Ord for Identifier<C>where
C: Ciphersuite,
impl<C> Ord for Identifier<C>where
C: Ciphersuite,
source§impl<C: PartialEq + Ciphersuite> PartialEq for Identifier<C>
impl<C: PartialEq + Ciphersuite> PartialEq for Identifier<C>
source§impl<C> PartialOrd for Identifier<C>where
C: Ciphersuite,
impl<C> PartialOrd for Identifier<C>where
C: Ciphersuite,
source§impl<C> Serialize for Identifier<C>where
C: Ciphersuite,
impl<C> Serialize for Identifier<C>where
C: Ciphersuite,
source§impl<C> TryFrom<u16> for Identifier<C>where
C: Ciphersuite,
impl<C> TryFrom<u16> for Identifier<C>where
C: Ciphersuite,
impl<C: Copy + Ciphersuite> Copy for Identifier<C>
impl<C> Eq for Identifier<C>where
C: Ciphersuite,
impl<C: Ciphersuite> StructuralPartialEq for Identifier<C>
Auto Trait Implementations§
impl<C> Freeze for Identifier<C>
impl<C> RefUnwindSafe for Identifier<C>
impl<C> Send for Identifier<C>
impl<C> Sync for Identifier<C>
impl<C> Unpin for Identifier<C>
impl<C> UnwindSafe for Identifier<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)