pub struct Share(pub Vec<u8>);Expand description
A Shamir simple secret share provides no integrity checking The first byte is the X-coordinate or identifier The remaining bytes are the Y-coordinate
Tuple Fields§
§0: Vec<u8>Implementations§
Sourcepub fn identifier(&self) -> u8
pub fn identifier(&self) -> u8
The identifier for this share
Sourcepub fn as_group_element<G: GroupEncoding>(&self) -> VsssResult<G>
pub fn as_group_element<G: GroupEncoding>(&self) -> VsssResult<G>
Convert this share into a group element
Sourcepub fn from_group_element<G: GroupEncoding>(
identifier: u8,
group: G,
) -> VsssResult<Self>
pub fn from_group_element<G: GroupEncoding>( identifier: u8, group: G, ) -> VsssResult<Self>
Convert group element into a share
Sourcepub fn as_field_element<F: PrimeField>(&self) -> VsssResult<F>
pub fn as_field_element<F: PrimeField>(&self) -> VsssResult<F>
Convert this share into a prime field element
Sourcepub fn from_field_element<F: PrimeField>(
identifier: u8,
field: F,
) -> VsssResult<Self>
pub fn from_field_element<F: PrimeField>( identifier: u8, field: F, ) -> VsssResult<Self>
Convert field element into a share
Trait Implementations§
Source§fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)