-
Notifications
You must be signed in to change notification settings - Fork 0
Remove NonceWrapper #64
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
Conversation
WalkthroughThis PR removes the NonceWrapper type and updates both Coordinator and SigningSession to store SigningNonces directly, eliminating indirection. Field types are changed from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Actionable comments posted: 2
🤖 Fix all issues with AI Agents
In @keep-core/src/frost/coordinator.rs:
- Around line 16-23: The Coordinator struct stores sensitive SigningNonces in
our_nonces but does not derive ZeroizeOnDrop; update the Coordinator definition
to derive Zeroize and ZeroizeOnDrop and mark all non-sensitive fields with
#[zeroize(skip)] while leaving our_nonces to be zeroized (i.e., do not skip it).
Specifically, add the Zeroize/ZeroizeOnDrop derives to the Coordinator struct
and annotate session_id, message, threshold, commitments, and signature_shares
with #[zeroize(skip)] so only our_nonces (Option<(Identifier, SigningNonces)>)
is cleared on drop, matching the SigningSession pattern.
- Around line 16-23: The comment claiming "SigningNonces doesn't implement
Zeroize" is outdated; remove the NonceWrapper wrapper in
keep-frost-net/src/session.rs and use SigningNonces directly (consistent with
keep-core::Coordinator's our_nonces field), or if the wrapper is still needed
for another reason, update the comment to clearly state that reason; locate the
NonceWrapper struct and its impl and either delete them and replace usages with
SigningNonces or revise the comment to explain the actual current rationale for
keeping the wrapper.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
keep-core/src/frost/coordinator.rskeep-core/src/frost/signing.rs
🧰 Additional context used
🧬 Code graph analysis (1)
keep-core/src/frost/signing.rs (1)
keep-frost-net/src/session.rs (1)
zeroize(24-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (5)
keep-core/src/frost/signing.rs (3)
100-100: LGTM!Direct storage of
SigningNoncesis correct, assuming the upstream crate now implementsZeroize.
143-143: LGTM!Passing
&noncesdirectly is correct after removing theNonceWrapper.
43-43: Code change is correct—SigningNonces is properly zeroized.The field
our_nonces: Option<SigningNonces>will be automatically zeroized when theSigningSessionstruct is dropped because it has the#[derive(ZeroizeOnDrop)]attribute and lacks the#[zeroize(skip)]directive. Since the code compiles successfully with this configuration,SigningNoncesfromfrost-secp256k1-tr2.2.0 must implement theZeroizetrait.keep-core/src/frost/coordinator.rs (2)
47-47: LGTM - but depends on adding ZeroizeOnDrop to Coordinator.Direct storage of
SigningNoncesis correct. However, ensure theCoordinatorstruct derivesZeroizeOnDrop(flagged separately) for proper zeroization.
102-102: LGTM!Passing
&noncesdirectly is correct after removing theNonceWrapper.
Closes #53 since this was fixed upstream.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.