Add set_reseed_interval to support tighter reseed cadences (#1523)#1541
Open
Arul-Sujith wants to merge 2 commits into
Open
Add set_reseed_interval to support tighter reseed cadences (#1523)#1541Arul-Sujith wants to merge 2 commits into
Arul-Sujith wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for configuring a custom reseed interval in
libcrux-hmac-drbg, directly addressing the feature request in issue #1523. It enables consumers to enforce a tighter, application-defined reseed cadence (e.g., reseeding from the OS every N bytes) as a defense-in-depth measure, independent of the DRBG's default global interval.Changes
HmacDrbgstate to maintain a localreseed_interval, which defaults to the SP 800-90A maximum (1 << 48).pub fn set_reseed_interval(&mut self, interval: u64)toHmacDrbgand therand-featuredHmacDrbgRngwrapper.RESEED_INTERVAL. A custom interval can force earlier reseeding, but it can never exceed the maximum interval allowed by the spec.generate()andneeds_reseed()to utilizeself.reseed_interval.self.reseed_intervalin place of the global constant, ensuring proofs remain sound.custom_reseed_intervalandcustom_reseed_interval_clamping) insidesrc/tests.rsto verify the early reseed triggering and the hard-cap logic.Fixes #1523