Skip to content
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

Remove Miri equality workaround function #421

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

AaronFeickert
Copy link
Contributor

@AaronFeickert AaronFeickert commented Aug 22, 2024

When testing with Miri, hash equality is checked using a workaround function that attempts to mimic constant-time functionality. This was done only because the constant_time_eq crate was not compatible with Miri.

However, thanks to a PR by @oconnor663, this incompatibility is no longer present, which means the workaround can be safely removed. This PR does so.

@oconnor663
Copy link
Member

LGTM, though it looks like it needs a tweak to pass CI:

error[E0277]: can't compare `[u8; 32]` with `&[u8; 32]`
   --> src/lib.rs:339:23
    |
339 |         return self.0 == other;
    |                       ^^ no implementation for `[u8; 32] == &[u8; 32]`
    |
    = help: the trait `std::cmp::PartialEq<&[u8; 32]>` is not implemented for `[u8; 32]`
help: consider dereferencing here
    |
339 |         return self.0 == *other;
    |                          +

@AaronFeickert
Copy link
Contributor Author

Good catch! I'm surprised that my IDE didn't complain about this. Will update.

@AaronFeickert
Copy link
Contributor Author

Should be good to go now.

@AaronFeickert
Copy link
Contributor Author

@oconnor663: This is now updated to account for the new constant_time_eq version that includes your fix.

@oconnor663 oconnor663 merged commit 8e2e07e into BLAKE3-team:master Aug 27, 2024
51 checks passed
@oconnor663
Copy link
Member

Thanks!

@AaronFeickert AaronFeickert deleted the nix-miri-equality branch August 28, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants