This project implements a thresholdized version of the Unbalanced Oil and Vinegar (UOV) digital signature scheme using the MPyC secure multi-party computation (MPC) framework. UOV is a multivariate quadratic (MQ) signature protocol and a candidate in the NIST Post-Quantum Cryptography Standardization process.
- Thresholdized UOV: The signing key is distributed among multiple parties; a threshold of parties must collaborate to generate a valid signature.
- Secure Multi-Party Computation: Built on MPyC, enabling distributed trust and privacy-preserving computation.
- Post-Quantum Security: UOV is designed to resist attacks from quantum computers.
- Flexible Parameters: Easily configure the number of parties, threshold, and UOV parameters.
- MPyC (Multi-Party Computation in Python)
- numpy (matrix and vector operations)
- gmpy2 (arbitrary precision arithmetic)
- implicit-globals (for field context management)
- uvloop (optional, for faster event loops on non-Windows)
nix develop
This will provide a shell with all dependencies available.
With uv
pip install uv
uv venv
uv pip install .
Or, using plain pip:
python3 -m venv .venv
source .venv/bin/activate
pip install .
python3 -m src.main
To run with N parties, open N shells and run in each:
python3 -m src.main -M<N> -I<id>
where <N>
is the number of parties and <id>
is the party index (0 to N-1).
Example (N=3):
python3 -m src.main -M3 -I0
python3 -m src.main -M3 -I1
python3 -m src.main -M3 -I2
You can set the threshold t
(number of parties required to sign) with the
-T<t>
flag:
python3 -m src.main -M5 -T2 -I0
where 0 <= t < n/2
.
- The
src/mp-spdz/
folder contains an early attempt at implementing the protocol using the MP-SPDZ framework. This approach was discontinued in favor of MPyC, which offers a more Pythonic and flexible library interface, making development and experimentation easier. - The main protocol logic is in
src/main.py
and supporting modules insrc/
.
For more technical/developer details, see DEVELOPER.md.