[−][src]Struct private_currency::crypto::Opening
Opening for a Pedersen commitment.
Theory
See Commitment docs for details on Pedersen commitments and their openings.
Arithmetic
Akin to Commitments, openings can be added and subtracted. If an over/underflow occurs
when adding or subtracting committed values, a panic is raised.
Implementation details
Although committed value x is generally a scalar in the used prime-order group,
we restrict it to u64. The conversion is straightforward.
Fields
value: u64
Committed value.
Methods
impl Opening[src]
impl Openingpub fn from_slice(slice: &[u8]) -> Option<Self>[src]
pub fn from_slice(slice: &[u8]) -> Option<Self>Attempts to deserialize an opening from a slice.
pub fn to_bytes(&self) -> Vec<u8>[src]
pub fn to_bytes(&self) -> Vec<u8>Serializes this opening to bytes.
Implementation details
Serialization consists of a committed value (8 bytes, little-endian) and a Ristretto scalar (32 bytes).
Trait Implementations
impl Clone for Opening[src]
impl Clone for Openingfn clone(&self) -> Opening[src]
fn clone(&self) -> Openingfn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Eq for Opening[src]
impl Eq for Openingimpl PartialEq<Opening> for Opening[src]
impl PartialEq<Opening> for Openingimpl Debug for Opening[src]
impl Debug for Openingimpl Sub<Opening> for Opening[src]
impl Sub<Opening> for Openingtype Output = Self
The resulting type after applying the - operator.
fn sub(self, rhs: Self) -> Self[src]
fn sub(self, rhs: Self) -> Selfimpl<'a, 'b> Sub<&'b Opening> for &'a Opening[src]
impl<'a, 'b> Sub<&'b Opening> for &'a Openingtype Output = Opening
The resulting type after applying the - operator.
fn sub(self, rhs: &'b Opening) -> Opening[src]
fn sub(self, rhs: &'b Opening) -> Openingimpl Add<Opening> for Opening[src]
impl Add<Opening> for Openingtype Output = Self
The resulting type after applying the + operator.
fn add(self, rhs: Self) -> Self[src]
fn add(self, rhs: Self) -> Selfimpl AddAssign<Opening> for Opening[src]
impl AddAssign<Opening> for Openingfn add_assign(&mut self, rhs: Self)[src]
fn add_assign(&mut self, rhs: Self)impl SubAssign<Opening> for Opening[src]
impl SubAssign<Opening> for Openingfn sub_assign(&mut self, rhs: Self)[src]
fn sub_assign(&mut self, rhs: Self)Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T> Erased for T
impl<T> Erased for Timpl<T> Erased for T
impl<T> Erased for Timpl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, fn equivalent(&self, key: &K) -> bool[src]
fn equivalent(&self, key: &K) -> boolimpl<T> Same for T
impl<T> Same for Ttype Output = T
Should always be Self