2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-06 16:57:25 +00:00

refactor: cryptography component

This commit is contained in:
Jan
2025-04-25 21:26:44 +01:00
committed by Jan Laupetin
parent 60f5c1a18f
commit 5635470b6e
63 changed files with 550 additions and 723 deletions

View File

@@ -1,7 +1,7 @@
#include "XChunkProcessorSalsa20Decryption.h"
#include "AbstractSalsa20Processor.h"
#include "Crypto.h"
#include "Cryptography.h"
#include <cassert>
@@ -21,10 +21,10 @@ size_t XChunkProcessorSalsa20Decryption::Process(
assert(output != nullptr);
assert(inputLength <= outputBufferSize);
auto& streamContext = m_stream_contexts[streamNumber];
const auto& streamContext = m_stream_contexts[streamNumber];
// Initialize Salsa20 with an IV of the first 8 bytes of the current hash block
streamContext.m_salsa20->SetIV(GetHashBlock(streamNumber), SALSA20_IV_SIZE);
streamContext.m_salsa20->SetIv(GetHashBlock(streamNumber), SALSA20_IV_SIZE);
streamContext.m_salsa20->Process(input, output, inputLength);
// Hash decrypted XChunk