Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

michaelelliot/noir-rsa-optimised

Repository files navigation

noir-rsa-optimised

Overview

This example demonstrates how to precompute particular values used for RSA decryption in a Noir circuit to optimise proving and verifying times. This is achieved by minimising the amount of division operations needed by providing the quotient to the circuit which can then perform multiplication instead, and by only doing the last exponentiation of the the RSA public exponent e. Essentially: (sig * final_e) - (pubkey * quotient)

Note: My assumption is that even with these optimisations, the strong RSA assumption still holds, because we're still performing a modulo with the public key. Please reach out to me if my assumptions about the RSA assumptions is a wrong assumption! :)

Usage

Run tests:

nargo test --show-output

Prove:

nargo prove

Verify:

nargo verify

Precompute Inputs

Run the ./scripts/precompute_inputs.py script to precompute the optimised circuit inputs.

About

Optimised RSA for Noir circuits

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published