This repository contains a prototype implementation (in Python) of the SmallWood proof system and the CAPSS framework.
- SmallWood is a hash-based proof system targeting small-to-medium statements.
- CAPSS is a framework for constructing SNARK-friendly, post-quantum signature schemes from arithmetization-oriented permutations.
📄 The accompanying papers introducing SmallWood and CAPSS are available on the IACR ePrint archive: https://eprint.iacr.org/2025/1085 and https://eprint.iacr.org/2025/061.
The Python implementation relies on SageMath.
- The folder
smallwoodimplements the SmallWood proof systems:- The sub-folder
commitimplements Merkle trees (merkle), the degree-enforcing commitment scheme (decs), the SmallWood-LVCS (lvcs) and the SmallWood polynomial commitment scheme (pcs). - The sub-folder
pacsimplements the logic of the parallel and aggregated constraint systems (PACS), which is the input constrain system format of the proof system SmallWood. - The file
smallwood.pyimplements the SmallWood proof system, independently of the used hash functions. The fileshake.pyandaohash.pyare then respectively instantiations of the proof systems using respectively SHAKE and arithmetization-oriented hash functions.
- The sub-folder
- The folder
utilsimplements from helpers to deal with arrays, buffer, polynomials, logs, etc. - The folder
r1csimplements a R1CS compiler, namely a tool that derive on-the-fly a R1CS constraints of a Python code. - The folder
capssimplements the CAPSS framework from the SmallWood proof systems based on arithmetization-oriented hash functions.- The sub-folder
hashcontains implementations of AO permutations. At the time of writing, there are Anemoi (anemoi), Griffin (griffin), Poseidon (poseidon), and RescuePrime (rescue). - The sub-folder
pacsimplements the PACS arithemization for verifying an execution of an AO permutation, including the Regular-Permutation arithmetization and the Sbox-centrix arithmetization. - The sub-folder
signimplements the CAPSS signature scheme.
- The sub-folder
Run the script
sage --python3 test.py G256-3 defaultIt gives the signature size and the parameters of the R1CS constraints encoding the verification algorithm for the CAPSS signature scheme based on Griffin-3 over a 256-bit field, with trade-off "default".
This project is licensed under the terms of Apache License (version 2.0).