-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add BSGS for new field PVSS #18049
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
Add BSGS for new field PVSS #18049
Conversation
das and ark_std::randThere 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.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on November 7
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
alinush
left a comment
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.
Let's discuss!
| H: sigma_protocol::Trait<E>, | ||
| LargerDomain: Witness<E>, | ||
| { | ||
| fn dst(&self) -> Vec<u8> { |
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.
I think we gotta be a bit careful here. It may be easier to use hashing to ensure non-ambiguity.
Not saying what you have is wrong, but it may be harder to reason about.
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.
In general, please also take a look at my thoughts here regarding domain separation & let's discuss a little.
I think out of those 3 things we are missing a session ID which we may want to add.
| &self, | ||
| public_statement: &Self::Codomain, | ||
| proof: &Proof<E, Self>, | ||
| proof: &Proof<E, H>, // Would like to set &Proof<E, Self>, but that ties the lifetime of H to that of Self, but we'd like it to be eg static |
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.
How come this was not a problem so far?
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.
(Perpetually worried about how this abstraction is getting out of hand... 😨 )
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.
How come this was not a problem so far?
It was, this stuff is largely inspired by the old PR.
| { | ||
| /// No-op: circumvents the fact that proofs inherit the homomorphism’s lifetime. This method does nothing at runtime. | ||
| #[allow(non_snake_case)] | ||
| pub fn change_lifetime<H2>(self) -> Proof<E, H2> |
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.
I am so confused right now...
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.
Homomorphisms often carry references to public parameters, but the Proof does not. So the lifetime of the Proof should not depend on that, but for some reason Rust doesn't think that way and ties the lifetime of Proof to its generic parameters.
A different workaround would be to make Proof generic over eg <E, H::Domain, H::Codomain> instead, but that seems uglier to me.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
ThresholdConfigtrait fromWeightedConfigaptos-dkg'sarkworkscode from usingark_std::randfor randomness, to our (older) crateranddas(weighted and unweighted), now it usesthread_rng()to generate random numbers.blstrs::Scalargenerate()method to existing range proof and sigma proof code, in order to make thegenerate()method of the new PVSS cleaner.sample()method from GroupGenerators and replaces it withdefault()since we can't sample securely at the moment, and don't really seem to need it anyway.change_lifetimemethod to sigma proofs, so it can be made independent of the homomorphismpp: &Self::PublicParameterstodecrypt_own_share(), this reverberates through a lot of codeHow Has This Been Tested?
aptos-dkgtestsKey Areas to Review
dasis secure.aptos-core/typeshad to be modified due to thedecrypt_own_share()change, hopefully not an issue.Type of Change
Which Components or Systems Does This Change Impact?
Checklist
Note
Introduces a BSGS dlog helper, switches DKG/arkworks code to rand-based RNGs with new random utilities, removes Fiat‑Shamir from DAS, adds pp to decrypt_own_share, and extends sigma/range proof infra (incl. generators), updating benches/tests/types accordingly.
dlog/bsgs(baby-step giant-step) with table builder and tests.aptos_crypto::arkworks::randomutilities (UniformRand, sample_field_element[s], unsafe_random_point[s]).ark_std::randwithrandacross modules;GroupGeneratorsnowDefault()(generator-based) instead ofsample().thread_rng()/random scalars.Transcript::decrypt_own_share(...)signature to includepp: &Self::PublicParameters; propagate through weighted/unweighted PVSS, generic weighting, tests, benches, andtypes/real_dkg.pvss/das/fiat_shamir.rs.TraitforLiftHomomorphismand add proper DST composition.Proof::change_lifetimeand enable verification with generic hom types.rand_corebounds consistently in witnesses and proofs.CommitmentandCommitmentRandomness(alias toScalar), adapt open/verify.generate()helpers, minor API tweaks (commit randomness handling), FS helpers streamlined.GroupGenerators::default()and new APIs; add random proof generators.decrypt_own_shareparam and RNG changes; add BSGS test.ThresholdConfigimpl fromWeightedConfig.fastrand2.3.0,proc-macro21.0.103).Written by Cursor Bugbot for commit 013d7f1. This will update automatically on new commits. Configure here.