pub struct PrimalityCertificate { /* private fields */ }Expand description
A checkable proof that a specific number is prime.
Produced by prove_prime and re-checked, independently of how it was
built, by PrimalityCertificate::verify. The certificate is recursive:
verifying it re-derives every step, including the primality of each prime
factor of F, so a passing verify is a
self-contained proof.
Implementations§
Source§impl PrimalityCertificate
impl PrimalityCertificate
Sourcepub fn bound(&self) -> Option<Bound>
pub fn bound(&self) -> Option<Bound>
The size bound on the factored part F this proof relied on, or None
for a small (< 2^64, Baillie–PSW) certificate.
Sourcepub fn verify(&self, n: &Int) -> bool
pub fn verify(&self, n: &Int) -> bool
Re-checks the certificate from scratch, returning true only if it is a
valid proof that n (which must equal the number the certificate was
built for) is prime.
This shares no state with prove_prime: it recomputes F, re-verifies
every witness congruence, recursively re-checks each prime factor of F,
and (for a BLS proof) re-runs the discriminant test. Tampering with any
field makes it return false.
Trait Implementations§
Source§impl Clone for PrimalityCertificate
impl Clone for PrimalityCertificate
Source§fn clone(&self) -> PrimalityCertificate
fn clone(&self) -> PrimalityCertificate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more