mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +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
Notes:
sideshowbarker
2024-07-19 07:06:06 +09:00
Author: https://github.com/alimpfard
Commit: 8c645916b4
Pull-request: https://github.com/SerenityOS/serenity/pull/1661
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/itamar8910
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