pub struct ModProof {
pub reps: Vec<ModRep>,
}Expand description
Proof: r_mod repetitions.
Fields§
§reps: Vec<ModRep>Implementations§
Source§impl ModProof
impl ModProof
Sourcepub fn prove<R: CryptoRng + ?Sized>(
rng: &mut R,
tx: &Transcript,
params: &Params,
n: &BoxedUint,
w: &ModWitness<'_>,
) -> Result<Self>
pub fn prove<R: CryptoRng + ?Sized>( rng: &mut R, tx: &Transcript, params: &Params, n: &BoxedUint, w: &ModWitness<'_>, ) -> Result<Self>
Proves that N = p1·p2 is well formed.
Sourcepub fn verify(
&self,
tx: &Transcript,
params: &Params,
n: &BoxedUint,
min_bits: u32,
) -> Result<()>
pub fn verify( &self, tx: &Transcript, params: &Params, n: &BoxedUint, min_bits: u32, ) -> Result<()>
Verifies the proof for N; min_bits is the required bit length of N.
Sourcepub fn encoded_len(params: &Params, n_bits: u32) -> usize
pub fn encoded_len(params: &Params, n_bits: u32) -> usize
Encoded length: r_mod · (1 + 2·⌈bits(N)/8⌉).
Sourcepub fn encode(&self, n_bits: u32) -> Result<Vec<u8>>
pub fn encode(&self, n_bits: u32) -> Result<Vec<u8>>
Per repetition: byte a | b << 1, then x and z as fixed-width big-endian.
pub fn decode(bytes: &[u8], params: &Params, n_bits: u32) -> Result<Self>
Trait Implementations§
impl Eq for ModProof
impl StructuralPartialEq for ModProof
Auto Trait Implementations§
impl Freeze for ModProof
impl RefUnwindSafe for ModProof
impl Send for ModProof
impl Sync for ModProof
impl Unpin for ModProof
impl UnsafeUnpin for ModProof
impl UnwindSafe for ModProof
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