[−][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 Commitment
s, 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 Opening
pub 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 Opening
fn clone(&self) -> Opening
[src]
fn clone(&self) -> Opening
fn 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 Opening
impl PartialEq<Opening> for Opening
[src]
impl PartialEq<Opening> for Opening
impl Debug for Opening
[src]
impl Debug for Opening
impl Sub<Opening> for Opening
[src]
impl Sub<Opening> for Opening
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
fn sub(self, rhs: Self) -> Self
impl<'a, 'b> Sub<&'b Opening> for &'a Opening
[src]
impl<'a, 'b> Sub<&'b Opening> for &'a Opening
type Output = Opening
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b Opening) -> Opening
[src]
fn sub(self, rhs: &'b Opening) -> Opening
impl Add<Opening> for Opening
[src]
impl Add<Opening> for Opening
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
fn add(self, rhs: Self) -> Self
impl AddAssign<Opening> for Opening
[src]
impl AddAssign<Opening> for Opening
fn add_assign(&mut self, rhs: Self)
[src]
fn add_assign(&mut self, rhs: Self)
impl SubAssign<Opening> for Opening
[src]
impl SubAssign<Opening> for Opening
fn 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 T
impl<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) -> TypeId
impl<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 T
impl<T> Erased for T
impl<T> Erased for T
impl<T> Erased for T
impl<T> Erased for T
impl<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) -> bool
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self