pub struct U64RangeProofProtocol {
pub g: ProjectivePoint,
pub g_vec: Vec<ProjectivePoint>,
pub h_vec: Vec<ProjectivePoint>,
}Expand description
Represents public information for reciprocal range proof protocol for [0..2^64) range.
Fields§
§g: ProjectivePointWill be used for the value commitment as: commitment = x*g + s*h_vec[0]
g_vec: Vec<ProjectivePoint>Dimension: 16
h_vec: Vec<ProjectivePoint>Will be used for the value commitment as: commitment = x*g + s*h_vec[0]
Dimension: 26+6=32
Implementations§
Source§impl U64RangeProofProtocol
impl U64RangeProofProtocol
Sourcepub fn commit_value(&self, x: u64, s: &Scalar) -> ProjectivePoint
pub fn commit_value(&self, x: u64, s: &Scalar) -> ProjectivePoint
Creates commitment for the private value and blinding: commitment = x*g + s*h_vec[0]
Sourcepub fn verify(
&self,
v: &ProjectivePoint,
proof: Proof,
t: &mut Transcript,
) -> bool
pub fn verify( &self, v: &ProjectivePoint, proof: Proof, t: &mut Transcript, ) -> bool
Verifies that committed value in v lies in range [0..2^64).
Sourcepub fn prove<R>(
&self,
x: u64,
s: &Scalar,
t: &mut Transcript,
rng: &mut R,
) -> Proof
pub fn prove<R>( &self, x: u64, s: &Scalar, t: &mut Transcript, rng: &mut R, ) -> Proof
Creates proof that values x with blinding s lies in [0..2^64).
pub fn u64_to_hex(x: u64) -> Vec<Scalar>
pub fn u64_to_hex_mapped(x: u64) -> Vec<Scalar>
Trait Implementations§
Source§impl Clone for U64RangeProofProtocol
impl Clone for U64RangeProofProtocol
Source§fn clone(&self) -> U64RangeProofProtocol
fn clone(&self) -> U64RangeProofProtocol
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for U64RangeProofProtocol
impl RefUnwindSafe for U64RangeProofProtocol
impl Send for U64RangeProofProtocol
impl Sync for U64RangeProofProtocol
impl Unpin for U64RangeProofProtocol
impl UnwindSafe for U64RangeProofProtocol
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