mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
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:
parent
ca097b093b
commit
8c645916b4
6 changed files with 342 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue