pub struct DlogProof {
pub e: SBig,
pub z: Scalar,
}Expand description
Compact proof (e, z).
Fields§
§e: SBig§z: ScalarImplementations§
Source§impl DlogProof
impl DlogProof
Sourcepub fn prove<R: CryptoRng + ?Sized>(
rng: &mut R,
tx: &Transcript,
params: &Params,
x_pub: &ProjectivePoint,
x: &Scalar,
) -> Result<Self>
pub fn prove<R: CryptoRng + ?Sized>( rng: &mut R, tx: &Transcript, params: &Params, x_pub: &ProjectivePoint, x: &Scalar, ) -> Result<Self>
Proves knowledge of x with X = g^x.
Sourcepub fn verify(
&self,
tx: &Transcript,
params: &Params,
x_pub: &ProjectivePoint,
) -> Result<()>
pub fn verify( &self, tx: &Transcript, params: &Params, x_pub: &ProjectivePoint, ) -> Result<()>
Verifies the proof for X.
Sourcepub fn encode(&self, params: &Params) -> Result<Vec<u8>>
pub fn encode(&self, params: &Params) -> Result<Vec<u8>>
e (sign byte + ⌈(ℓ−1)/8⌉ bytes) ‖ z (32 bytes).
pub fn encoded_len(params: &Params) -> usize
pub fn decode(bytes: &[u8], params: &Params) -> Result<Self>
Trait Implementations§
impl Eq for DlogProof
impl StructuralPartialEq for DlogProof
Auto Trait Implementations§
impl Freeze for DlogProof
impl RefUnwindSafe for DlogProof
impl Send for DlogProof
impl Sync for DlogProof
impl Unpin for DlogProof
impl UnsafeUnpin for DlogProof
impl UnwindSafe for DlogProof
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