Cryptographic accumulators with privately delegatable proof updates in Rust. Supports RSA, class-group, and bilinear constructions.
Warning
This is an academic prototype, it has not received careful code review. Therefore, this implementation is NOT ready for production use.
[dependencies]
private-accumulator-proof-delegation = "0.1.0"use num_bigint::{BigUint, ToBigInt};
use private_accumulator_proof_delegation::rsa_group::RsaGroup;
use private_accumulator_proof_delegation::RsaAccumulator;
let mut acc = RsaAccumulator::<RsaGroup>::setup();
// Add elements to the accumulator
let element = BigUint::from(7u32);
let ep = acc.add(&element);
for i in 2u32..5 {
acc.add(&BigUint::from(i));
}
// Prove and verify membership
let proof = acc
.mem_proof_create(&ep)
.expect("element was just added; proof must exist");
assert!(acc.mem_ver(&proof, &ep));
// Prove and verify non-membership
let non_element = BigUint::from(383u32);
let product = acc.calculate_product_unreduced().to_bigint().unwrap();
let non_proof = acc
.non_mem_proof_create(&non_element, &product)
.expect("non-element is coprime with the set product");
assert!(acc.non_mem_ver(&non_proof, &non_element));A runnable version lives in examples/basic_rsa.rs:
cargo run --example basic_rsa --releasecargo testThe default features (rsa, bilinear) require no system dependencies. The optional class-group feature pulls in class_group/curv-kzen and requires GMP and PARI to be installed (brew install gmp pari on macOS, apt-get install libgmp-dev pari-gp on Debian/Ubuntu):
cargo test --features class-group- RSA accumulator — membership and non-membership proofs in groups of unknown order.
- Class-group instantiation — a trapdoorless alternative to RSA: no trusted setup, at the cost of larger group elements and slower operations.
- Bilinear accumulator — KZG-style construction over BLS12-381.
- Privacy-preserving update delegation — clients blind their proofs before sending them to an untrusted server, the server updates the blinded proof, and the client verifies the work via NIZK proofs of discrete-log equality and unblinds to recover a valid up-to-date proof. The server learns nothing about the underlying element.
- Cargo features to opt into individual constructions:
rsaandbilinearare on by default; enableclass-groupfor the trapdoorless variant.
cargo benchPlotting helpers in figures/ reproduce the benchmark figures from the accompanying paper. They require Python with pandas, matplotlib, and seaborn installed.
This library builds on the work of the arkworks ecosystem (ark-ec, ark-ff, ark-poly-commit, ark-bls12-381), the class_group and curv-kzen crates for class-group arithmetic, and glass_pumpkin for safe-prime generation.