Add gungraun constant-time benchmarks and checker#1005
Open
xyzzyz wants to merge 1 commit intoRustCrypto:masterfrom
Open
Add gungraun constant-time benchmarks and checker#1005xyzzyz wants to merge 1 commit intoRustCrypto:masterfrom
xyzzyz wants to merge 1 commit intoRustCrypto:masterfrom
Conversation
Introduce gungraun-based benches for Uint operations behind the ct_gungraun harness. Add a check_ct_gungraun helper binary that parses gungraun summary.json v6, and enforces constant-time instruction counts for non-vartime benchmark groups.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1005 +/- ##
==========================================
- Coverage 79.87% 79.87% -0.01%
==========================================
Files 163 163
Lines 17593 17593
==========================================
- Hits 14053 14052 -1
- Misses 3540 3541 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
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 is a proof of concept for using Gungraun for testing constant-timeness of the operations. The purpose of this PR is less so getting it merged, and more so gauging your interest in this work.
Gungraun uses Valgrind tooling to obtain accurate instruction counts for benchmark executions. This allows comparing runs on different inputs to see if the instruction counts are the same.
I added a number of Gungraun benchmarks, along with a simple binary to process the results (with the intention of using it in CI pipeline). Interestingly, I found that while Gungraun calculates the exact same instruction count for add/sub/mul and GCD operations, it finds tiny differences between
mod_powruns on different arguments (on the order of 0.005% difference in instruction counts).Are you interested in including this in
crypto-biginttest suite? If so, do you have any suggestions for next steps? Some of the ones I see are:mod_pow.Thanks for your feedback!