-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More concise share backups #182
Conversation
24f9971
to
fca8e6a
Compare
fb4502a
to
1b6a720
Compare
@nickfarrow ready for your review. Review each commit independently is probably best. |
) { | ||
let b = bpoly.into_iter(); | ||
for (i, b) in b.enumerate() { | ||
if i == apoly.len() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at first glance i thought this was wrong because of the ==
for unequal length polys, but the following push makes it repeat this branch on the next iteration 👍
Could you explain this one to me, why allow a frost secret share to be zero? While zero isnt inherently forbidden for secret shares, it should never occur from a secure keygen, only if someone is cancelling out secret poly(s) and that might be worth panicking (perhaps not in this way!). I want to understand when to make things 'illegal', only when it's actually illegal within that context (like |
schnorr_fun/src/frost/share.rs
Outdated
fn recover_secret(parties in 1usize..10, threshold in 1usize..5) { | ||
use rand::seq::SliceRandom; | ||
let frost = frost::new_with_deterministic_nonces::<sha2::Sha256>(); | ||
let parties = parties.max(threshold); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use (parties, threshold) in (1usize..=10).prop_flat_map(|n| (Just(n), 1usize..=n))
but it's also kind of confusing
- More understandable (and faster) internals - Added `lagrange_basis_poly` function. Made it public because why not. - Added `scalar::mul` function to multiply two polynomials - Added `add_in_place` functions - Fixed missing API surface area
Some funny expect was turning them into `NonZero`. It made no sense in the current code and maybe never did!
Having a concept of a secret share seemed to be useful generally. This makes the share backup feature less boxed off. Also we now embed the share index in the human readable part when we can.
fd1972e
to
5d86d94
Compare
minor fixups in 5d86d94, re-added and updated frost proptest. Everything LGTM! |
This is true for every value that |
Exploring smaller backups by removing polynomial identifier and threshold (should be written in plaintext alongside the bech32 backup).