-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update SHA module #18
Merged
Merged
Conversation
This file contains 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
Remove the bit-oriented test vectors. The current protocol only passes the message to hash without indication of its length in bits, making it impossible to test bit-oriented implementations. Furthermore, it seems that not many implementations are bit-oriented [1], which is anecdotally confirmed by the absence of bug reports on this mode. In a first time, the main user-visible change is the fact that `test` raises ValueError if the given orientation is BIT. The next step is to remove the orientation completely. If there are users of this mode, we may add them back. In that case, we should create separate test vectors with an additional `len` field, as well as a separate test function. For users of the test vectors, the ShaVectors class from `vectors.SHA` is replaced by the protobuf class `vectors._sha.sha_pb2.ShaVectors`. The test vectors themselves are simplified, as we did with the SHAKE vectors. The tests from the LongMsg and ShortMsg files are combined into a single instance of ShaVectors, along with a new mc_test field for Monte Carlo tests. This means that only a single Results is returned per test vectors file. [1]: https://csrc.nist.rip/groups/STM/cavp/documents/shs/shaval.html
Following the update of the SHA test vectors, remove the Orientation parameter, as crypto-condor does not properly test bit-oriented implementations.
Wrong indentation from previous version meant that only the last test was actually counted.
It was not needed as we only have compliance test vectors for now, but better to start including the option in all primitives.
Move the Python wrapper to the new format with naming convention. Update the example to test this format, and add the corresponding doc page. The page includes the wrapper example, instead of only examples of function names.
Add a harness test using OpenSSL and include it in the documentation as an usage example. crypto-condor now passes the size of the output buffer, mainly in case implementations need to copy the output from another buffer.
Replaces the `test` function to explicitely add the name of the operation being tested to the function name.
Continuing with a standardisation of the function names, add `test_output_digest` to replace `verify_file`. The latter is deprecated but not yet removed to maintain compatibility.
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.
ShaVectors
instance.