Closed ibigbug closed 1 year ago
Use finalize_reset
i think i didn't make it clear - it's not about resetting the state. i.e. continue to write more data after finalize() and finalize() again with more data.
Then you want to Clone
prior to finalization
Also, merlin was more designed for this sort of thing.
As an aside, rust maybe needs some replace_with
method that makes reset methods unnecessary by ensuring zero copies: https://github.com/rust-lang/rfcs/pull/2884#issuecomment-1304576176
It appears https://docs.rs/replace_with/ provides equivalent functionality to the *reset
methods.
it seems the
finalize()
will consume the hasher:https://docs.rs/md-5/latest/md5/trait.Digest.html#tymethod.finalize
how ever it doesn't reset the state.
how to reuse and write more data into the hasher after finalized()?