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

Protect against re-using digested context #86

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

jakobnissen
Copy link
Contributor

Prevent users from calling update! on a context that has already been finalized, and warn against doing this in the docstring of digest!

If storing a Bool in the structs is too wasteful (8-bytes alignment and all), we can use the top bit of the bytecount field instead. Let me know if you think this optimisation is worth the additional implementation complexity.

Closes #85

Prevent users from calling `update!` on a context that has already been
finalized, and warn against doing this in the docstring of `digest!`
@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2023

Codecov Report

Base: 96.16% // Head: 96.51% // Increases project coverage by +0.35% 🎉

Coverage data is based on head (2de741c) compared to base (2d1f84e).
Patch coverage: 89.47% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
+ Coverage   96.16%   96.51%   +0.35%     
==========================================
  Files           8        8              
  Lines         391      402      +11     
==========================================
+ Hits          376      388      +12     
+ Misses         15       14       -1     
Impacted Files Coverage Δ
src/sha3.jl 92.45% <66.66%> (+0.29%) ⬆️
src/common.jl 100.00% <100.00%> (ø)
src/types.jl 95.00% <100.00%> (+1.57%) ⬆️
src/SHA.jl 89.65% <0.00%> (+0.36%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vchuravy
Copy link

This broke MD5.jl

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.

Docs: Say that contexts are unusable after calling digest!
4 participants