Refactor Crypto/Utils lib to make it Linux compatible

This commit is contained in:
Jan
2021-03-01 08:17:18 -08:00
parent 22402766af
commit b6b0a57232
6 changed files with 14 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#include "AlgorithmSalsa20.h"
#include "salsa20.h"
#include <cassert>
#include <exception>
#include <stdexcept>
class AlgorithmSalsa20::AlgorithmSalsa20Impl
{
@ -27,7 +27,7 @@ public:
if(ivSize != 8)
{
throw std::exception("Salsa20 IV size must be 8");
throw std::invalid_argument("Salsa20 IV size must be 8");
}
Salsa20_IVSetup(&m_context, iv);
@ -84,4 +84,4 @@ void AlgorithmSalsa20::SetIV(const uint8_t* iv, const size_t ivSize)
void AlgorithmSalsa20::Process(const void* plainText, void* cipherText, const size_t amount)
{
m_impl->Process(plainText, cipherText, amount);
}
}