Assumptions for removing corner cases from example: files are at least 2 mb in size.
I want to create two hashes from the same file.
The first hash should be created from the first mb of the file, the second one should be created from the entire file (including the first mb).
If I use the implementations from Rust Crypto, I have to calculate the hash for the first mb twice, as the only way to access the hash is to call finalize and thereby consuming the hasher, or keeping the hasher but also resetting it in the process (if I got that correctly). There also seems to be no way to transfer the state of one e.g. Sha256 struct to another one (without redoing the hash calculation), so I don't see a way to avoid recalculating the hash for the first part of the file.
Am I getting this right or did I miss something? And if I am right, is there a good reason for why this is not possible?