1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! # Proofs of properties of RSA or Paillier modulus
//!
//! Implements the protocols described in the papers [Efficient Noninteractive Certification of RSA Moduli and Beyond](https://eprint.iacr.org/2018/057) and [UC Non-Interactive, Proactive, Distributed ECDSA with Identifiable Aborts](https://eprint.iacr.org/2021/060). Also refer [this](https://www.zkdocs.com/docs/zkdocs/zero-knowledge-protocols/product-primes/).
//!
//! For a given composite RSA or Paillier modulus `N`
//! - [Proof that `gcd(x, N) = 1` for a given `x`](src/gcd_is_one.rs)
//! - [Proof that `N` is square free](src/square_free.rs)
//! - [Proof that `N` is product 2 distinct primes](src/product_of_two_primes.rs)
//! - [Proof that `N` is a Blum integer and square-free](src/blum_integer.rs)
//! - [A more efficient proof that `N` is a Blum integer and square-free](src/paillier_blum_modulus.rs)
//!
//! Uses following math
//! - [Legendre and Jacobi symbols](src/math/jacobi.rs),
//! - [square roots modulo prime and composite numbers]((src/math/sqrt.rs)),
//! - [checking if a composite number is formed of prime powers]((src/math/prime_check.rs)).
//!
//! By default, it uses standard library and [rayon](https://github.com/rayon-rs/rayon) for parallelization.
//!
//! For `no_std` support, build as
//!
//! `cargo build --no-default-features`
//!
//! and for wasm-32, build as
//!
//! `cargo build --no-default-features --target wasm32-unknown-unknown`
//!
extern crate alloc;