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

Fixes and moves the SHA256 busy check #689

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

kaczmarczyck
Copy link
Collaborator

Inside libraries/opensk, we want to preserve the property that there are never two SHA256 hashes calculates in parallel. This is useful to support hardware crypto that can't swap out its state.

To check this property, there was an assertion in libraries/crypto. However, the assertion

  • didn't work,
  • should have been in opensk instead
  • and should run in tests, but not when deployed.

Since Rust runs tests in parallel, this PR makes sure that the assertion only fails if two SHA256 are calculated within one thread.

Fixes #688

Inside `libraries/opensk`, we want to preserve the property that there
are never two SHA256 hashes calculates in parallel. This is useful to
support hardware crypto that can't swap out its state.

To check this property, there was an assertion in `libraries/crypto`.
However, the assertion

- didn't work,
- should have been in opensk instead
- and should run in tests, but not when deployed.

Since Rust runs tests in parallel, this PR makes sure that the assertion
only fails if two SHA256 are calculated within one thread.

Fixes google#688
@kaczmarczyck kaczmarczyck added the bug Something isn't working label Jul 3, 2024
@kaczmarczyck kaczmarczyck requested a review from ia0 July 3, 2024 14:00
@kaczmarczyck kaczmarczyck self-assigned this Jul 3, 2024
@coveralls
Copy link

Coverage Status

coverage: 97.141% (+0.001%) from 97.14%
when pulling 8bafce4 on kaczmarczyck:sha-busy-check
into 8a0ee9d on google:develop.

@kaczmarczyck kaczmarczyck merged commit 19063c4 into google:develop Jul 3, 2024
9 checks passed
@kaczmarczyck kaczmarczyck deleted the sha-busy-check branch July 3, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants