[](https://github.com/lovesh/composite_modulus_proofs/actions/workflows/test.yml)
[](https://github.com/lovesh/composite_modulus_proofs/blob/master/LICENSE)
[](https://deps.rs/repo/github/lovesh/composite_modulus_proofs)
[](https://crates.io/crates/composite_modulus_proofs)
[](https://docs.rs/composite_modulus_proofs/latest/composite_modulus_proofs/)
# 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](src/blum_integer.rs)
- [A more efficient proof that `N` is a Blum integer](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`