Conversation
| unsafe { s2n_constant_time_equals(a.as_ptr(), b.as_ptr(), a.len() as u32) } | ||
| } | ||
|
|
||
| fn comparison(criterion: &mut Criterion) { |
There was a problem hiding this comment.
What are we trying to do with this PR? Like, it is relevant for #4709, but once that is merged we're not really going to have a use for this comparison. If we're actually trying to benchmark s2n_constant_time_equals(), I would expect to see a test that checks that the comparison of [1, 2, 3, 4, 5] to [1, 0, 0, 0, 0] takes exactly as much time as the comparison of [1, 2, 3, 4, 5] to [1, 2, 3, 4, 5]. But maybe we trust that that case is covered with cbmc?
There was a problem hiding this comment.
Ya, I see this benchmark function as being strictly interested in the performance of s2n_constant_time_equals, and not at all concerned with the correctness of it. We formally assert its correctness with the ctverif proofs.
Co-authored-by: maddeleine <59030281+maddeleine@users.noreply.github.com>
Co-authored-by: maddeleine <59030281+maddeleine@users.noreply.github.com>
Co-authored-by: maddeleine <59030281+maddeleine@users.noreply.github.com>
- add comment for black_box
|
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Resolved issues:
Related to #4709
Description of changes:
This adds benchmarks specifically for
s2n_constant_time_equals.Testing:
Existing CI should pass.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.