LibCrypto: Add SHA512

There is quite a bit of avoidable duplication, however, I could not get
the compiler to be happy about SHA2<Size> (see FIXMEs)
This commit is contained in:
AnotherTest 2020-04-08 06:24:28 +04:30 committed by Andreas Kling
commit 8c645916b4
Notes: sideshowbarker 2024-07-19 07:06:06 +09:00
6 changed files with 342 additions and 4 deletions

View file

@ -91,6 +91,13 @@ namespace Hash {
m_buffer.overwrite(index, &input[offset], length - offset);
}
MD5::DigestType MD5::digest()
{
auto digest = peek();
reset();
return digest;
}
MD5::DigestType MD5::peek()
{
DigestType digest;
u8 bits[8];
@ -108,8 +115,6 @@ namespace Hash {
// store state (4 registers ABCD)
encode(&m_A, digest.data, 4 * sizeof(m_A));
reset();
return digest;
}