⚠️ Experimental code. Use at your own risk.
CSI‑FiSh (csifish crate) is a pure‑Rust implementation of the CSI-FiSh: Efficient Isogeny based Signatures through Class Group Computations
The design combines Supersingular Isogeny techniques with class‑group computations to obtain post‑quantum signatures with very small public keys.
This repo provides:
- Blinded, constant‑time arithmetic for the quadratic‑imaginary class group underlying CSI‑FiSh.
- Trait‑based API for key generation, signing and verification.
- Rayon parallelisation (
parallelCargo feature).
| Version / tool | |
|---|---|
| Rust | nightly 1.78 or newer (uses generic_const_exprs) |
| GMP | 6.2+ development headers (via rug / gmp-mpfr-sys) |
| OS | Linux, macOS, Windows (x86_64 / AArch64 tested) |
git clone https://github.com/your‑org/csifish.git
cd csifish
rustup toolchain install nightly
rustup override set nightly
cargo build --release # add --features parallel for multithreadingRunning the small self‑tests:
cargo test --releaseuse csifish::csifish::signature::SigningKey;
const CURVES: u32 = 256; // security parameter
const ROUNDS: u32 = 7; // number of Fiat–Shamir rounds
const HASHES: u32 = 11; // leaves per Merkle proof
fn main() {
// 1. Generate a signing key (= secret key)
let sk = SigningKey::<CURVES, ROUNDS, HASHES>::generate();
let vk = sk.verifying_key(); // derive verifying (public) key
// 2. Sign arbitrary messages
let msg = b"🐟 post‑quantum ahoy!";
let sig = sk
.try_sign(msg) // Signer trait provides try_sign()
.expect("failed to sign");
// 3. Verify signatures
vk.verify(msg, &sig).expect("invalid signature");
}See examples/ for complete runnable programs.
| Feature | Default | Description |
|---|---|---|
parallel |
❌ | Enable Rayon‑backed ParallelIterator implementations |
use-system-libs |
❌ | Link against the system‑installed GMP instead of the bundled one |
Although care was taken to follow constant‑time coding practices, this code is not guaranteed to be constant-time. Do not deploy in production systems or handle sensitive key material.
This project is distributed under the terms of the MIT license. See LICENSE for details.