This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently the `sha256t` module uses an alias to the `sha256::HashEngine`, this is a footgun because if a user accidentally uses the `sha256t` module the same way as the other hash modules they will get the wrong engine. For example this code looks fine but is buggy (it does not pre-tag the engine): ``` let mut engine = sha256t::HashEngine::new(); // Or `default()`. engine.input(some_data); let hash = engine.finalize(); ``` We can fix the situation by adding a `HashEngine<T>` type to the `sha256t` module and implementing `Default` for it by calling the `Tag::engine` function.
- Loading branch information
Showing
2 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
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
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