You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add SHA-512/224 and SHA-512/256 hash functions
SHA2-512/224 and SHA-512/256 implemented, using existing macros for sha2 functions. However, SHA2-512/224 has 224 bits, and that is not a multiple of 64. Thus, `write_u64()` used for writing state to resulting `out` slice cannot be used directly (as it would copy 4 bytes to few to out, or 4 to many).
Because of that a *proxy* struct `_Sha512_224` which outputs 256 bits is created, and its methods are simply called by proper `Sha512_224` struct. In the `result()` method a new vec, `res` is created, result is written to it, and then 28 first bytes are copied to `out` using a simple for loop.
SHA2-512/256 is implemented with just `impl_sha!(high Sha512_256, SHA512_256_INIT, 256)`.
It closes#47.
No description provided.
The text was updated successfully, but these errors were encountered: