Struct snarkvm_polycommit::kzg10::Randomness
source · [−]pub struct Randomness<E: PairingEngine> {
pub blinding_polynomial: Polynomial<E::Fr>,
}
Expand description
Randomness
hides the polynomial inside a commitment. It is output by KZG10::commit
.
Fields
blinding_polynomial: Polynomial<E::Fr>
For KZG10, the commitment randomness is a random polynomial.
Implementations
sourceimpl<E: PairingEngine> Randomness<E>
impl<E: PairingEngine> Randomness<E>
sourcepub fn is_hiding(&self) -> bool
pub fn is_hiding(&self) -> bool
Does self
provide any hiding properties to the corresponding commitment?
self.is_hiding() == true
only if the underlying polynomial is non-zero.
sourcepub fn calculate_hiding_polynomial_degree(hiding_bound: usize) -> usize
pub fn calculate_hiding_polynomial_degree(hiding_bound: usize) -> usize
What is the degree of the hiding polynomial for a given hiding bound?
Trait Implementations
sourceimpl<'a, E: PairingEngine> Add<&'a Randomness<E>> for Randomness<E>
impl<'a, E: PairingEngine> Add<&'a Randomness<E>> for Randomness<E>
sourceimpl<'a, E: PairingEngine> Add<(<E as PairingEngine>::Fr, &'a Randomness<E>)> for Randomness<E>
impl<'a, E: PairingEngine> Add<(<E as PairingEngine>::Fr, &'a Randomness<E>)> for Randomness<E>
sourceimpl<'a, E: PairingEngine> AddAssign<&'a Randomness<E>> for Randomness<E>
impl<'a, E: PairingEngine> AddAssign<&'a Randomness<E>> for Randomness<E>
sourcefn add_assign(&mut self, other: &'a Self)
fn add_assign(&mut self, other: &'a Self)
Performs the +=
operation. Read more
sourceimpl<'a, E: PairingEngine> AddAssign<(<E as PairingEngine>::Fr, &'a Randomness<E>)> for Randomness<E>
impl<'a, E: PairingEngine> AddAssign<(<E as PairingEngine>::Fr, &'a Randomness<E>)> for Randomness<E>
sourcefn add_assign(&mut self, (f, other): (E::Fr, &'a Randomness<E>))
fn add_assign(&mut self, (f, other): (E::Fr, &'a Randomness<E>))
Performs the +=
operation. Read more
sourceimpl<E: PairingEngine> CanonicalDeserialize for Randomness<E>
impl<E: PairingEngine> CanonicalDeserialize for Randomness<E>
sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
Reads Self
from reader
.
sourcefn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
fn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
Reads Self
from reader
without compression.
sourceimpl<E: PairingEngine> CanonicalSerialize for Randomness<E>
impl<E: PairingEngine> CanonicalSerialize for Randomness<E>
sourcefn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
Serializes self
into writer
.
fn serialized_size(&self) -> usize
sourcefn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
fn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
Serializes self
into writer
without compression.
fn uncompressed_size(&self) -> usize
sourceimpl<E: PairingEngine> Clone for Randomness<E>
impl<E: PairingEngine> Clone for Randomness<E>
sourceimpl<E: PairingEngine> Debug for Randomness<E>
impl<E: PairingEngine> Debug for Randomness<E>
sourceimpl<E: PairingEngine> Default for Randomness<E>
impl<E: PairingEngine> Default for Randomness<E>
sourceimpl<E: PairingEngine> FromBytes for Randomness<E>
impl<E: PairingEngine> FromBytes for Randomness<E>
sourceimpl<E: PairingEngine> Hash for Randomness<E>
impl<E: PairingEngine> Hash for Randomness<E>
sourceimpl<E: PairingEngine> PCRandomness for Randomness<E>
impl<E: PairingEngine> PCRandomness for Randomness<E>
sourcefn rand<R: RngCore>(hiding_bound: usize, _: bool, rng: &mut R) -> Self
fn rand<R: RngCore>(hiding_bound: usize, _: bool, rng: &mut R) -> Self
Samples randomness for commitments;
num_queries
specifies the number of queries that the commitment will be opened at.
has_degree_bound
indicates that the corresponding commitment has an enforced
strict degree bound. Read more
sourceimpl<E: PairingEngine> PartialEq<Randomness<E>> for Randomness<E>
impl<E: PairingEngine> PartialEq<Randomness<E>> for Randomness<E>
sourceimpl<E: PairingEngine> ToBytes for Randomness<E>
impl<E: PairingEngine> ToBytes for Randomness<E>
impl<E: PairingEngine> Eq for Randomness<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for Randomness<E> where
<E as PairingEngine>::Fr: RefUnwindSafe,
impl<E> Send for Randomness<E>
impl<E> Sync for Randomness<E>
impl<E> Unpin for Randomness<E> where
<E as PairingEngine>::Fr: Unpin,
impl<E> UnwindSafe for Randomness<E> where
<E as PairingEngine>::Fr: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more