pub struct SHA256Commitment<'a, T: 'a + Serialize> { /* private fields */ }
Expand description
An implementation of the Hash Commitment Scheme using the SHA256 hash function.
We store the party’s secret and random number as references because we don’t want to take ownership over those variables and avoid useless copies (we only perform read operations with them).
We use lifetime annotations as we need to store references to existing variables in our structure, so that an instance of SHA256Commitment can not outlive the references it holds.
Implementations§
Source§impl<'a, T: 'a + Serialize> SHA256Commitment<'a, T>
impl<'a, T: 'a + Serialize> SHA256Commitment<'a, T>
Sourcepub fn new(s: &'a T, r: &'a [u8]) -> SHA256Commitment<'a, T>
pub fn new(s: &'a T, r: &'a [u8]) -> SHA256Commitment<'a, T>
Creates a new party for the SHA256 Commitment Scheme using its secret and random number.
Trait Implementations§
Source§impl<'a, T: 'a + Serialize> HashCommitmentScheme<T> for SHA256Commitment<'a, T>
impl<'a, T: 'a + Serialize> HashCommitmentScheme<T> for SHA256Commitment<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for SHA256Commitment<'a, T>
impl<'a, T> RefUnwindSafe for SHA256Commitment<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SHA256Commitment<'a, T>where
T: Sync,
impl<'a, T> Sync for SHA256Commitment<'a, T>where
T: Sync,
impl<'a, T> Unpin for SHA256Commitment<'a, T>
impl<'a, T> UnwindSafe for SHA256Commitment<'a, T>where
T: RefUnwindSafe,
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