Skip to content

Commit 7cdd4b4

Browse files
authored
Differential tests (#14)
* save work * remove x and use option * fix poly coefficient generator * add `share_x` feature for share representation
1 parent 725e513 commit 7cdd4b4

7 files changed

Lines changed: 401 additions & 77 deletions

File tree

.github/workflows/rust.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ jobs:
115115
- name: Run tests
116116
run: cargo test --verbose
117117

118+
- name: Run tests for share_x
119+
run: cargo test --verbose --no-default-features --features "std, share_x"
120+
118121
test-nostd:
119122
name: test
120123
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ default = ["std", "zeroize_memory"]
2525
std = ["rand/std", "rand/std_rng"]
2626
fuzzing = ["std", "arbitrary"]
2727
zeroize_memory = ["zeroize"]
28+
share_x = []
2829

2930
[dependencies]
3031
rand = { version = "0.8.5", default-features = false }

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ You can run them with `cargo test` and `cargo bench`.
6666
| ------------ | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
6767
| Apple M1 Pro | [2.6976 µs 2.7007 µs 2.7039 µs] | [938.79 ps 939.83 ps 941.04 ps] | [190.00 µs 190.46 µs 191.06 µs] | [31.176 ns 31.311 ns 31.529 ns] | [23.196 ns 23.211 ns 23.230 ns] |
6868

69+
# Roadmap
70+
71+
- [Barycentric interpolation](https://epubs.siam.org/doi/10.1137/S0036144502417715)
72+
- shares serialization/deserialization
73+
- ssskit-cli
74+
- [Verifiable secret sharing](https://www.cs.umd.edu/~gasarch/TOPICS/secretsharing/feldmanVSS.pdf)
75+
- Next step: [Publicly verifiable secret sharing](https://crypto.ethz.ch/publications/files/Stadle96.pdf) with commitments over EC prime-field group (Ristretto255)
76+
- [Robust secret sharing](https://dl.acm.org/doi/pdf/10.1145/195613.195621)
77+
- [Threshold changeable secret resharing](https://alinush.github.io/2024/04/26/How-to-reshare-a-secret.html)
78+
- [Threshold changeable secret sharing with secure secret reconstruction](https://www.sciencedirect.com/science/article/abs/pii/S0020019020300156)
79+
- [Resharing Shamir Secret Shares to Change the Threshold](https://conduition.io/cryptography/shamir-resharing)
80+
- Arbitrary GF(2^k) support
81+
- Side-channel and constant time primitives. Integrate `subtle`
82+
- Optional SIMD feature for field operations
83+
- Better error handling: `thiserror` integration
84+
6985
# Contributing
7086

7187
If you find a vulnerability, bug or would like a new feature, [open a new issue](https://github.com/multifactor/ssskit/issues/new).

benches/benchmarks.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ fn recover<const POLY: u16>(c: &mut Criterion) {
2121
let shares = dealer.take(255).collect::<Vec<Share<POLY>>>();
2222

2323
c.bench_function("recover_secret", |b| {
24-
b.iter(|| sss.recover(black_box(&shares)))
24+
b.iter(|| {
25+
sss.recover(black_box(
26+
&shares
27+
.iter()
28+
.map(|s: &Share<POLY>| Some(s.clone()))
29+
.collect::<Vec<Option<Share<POLY>>>>(),
30+
))
31+
})
2532
});
2633
}
2734

0 commit comments

Comments
 (0)