Struct proj_crypto::asymmetric::commitments::CommitmentContext
[−]
[src]
pub struct CommitmentContext { pub commitment_value: Mpz, pub parameters: DHParams, // some fields omitted }
A structure containing all the data relating to a commitment. This contains secrets. Drop has been implemented for Mpz to clear the memory when it goes out of scope.
Fields
commitment_value: Mpz
The value of the commitment its self
parameters: DHParams
The diffie-hellman parameters used in the commitment. These can be disclosed publicly
Methods
impl CommitmentContext
[src]
fn get_opening(&self) -> Opening
Output the opening of this commitment
fn from_opening(opening: Opening,
params: DHParams)
-> Result<CommitmentContext, &'static str>
params: DHParams)
-> Result<CommitmentContext, &'static str>
Generate the commitment from the opening (deterministic)
fn from_data(data: Mpz,
params: DHParams)
-> Result<CommitmentContext, &'static str>
params: DHParams)
-> Result<CommitmentContext, &'static str>
Generate a commitment onto some data (non-deterministic)
fn to_commitment(&self) -> Commitment
Return the corresponding Commitment object