2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-06 19:21:52 +00:00
Files
OpenAssetTools/src/Crypto/Crypto.cpp
2021-03-16 20:42:48 +01:00

25 lines
762 B
C++

#include "Crypto.h"
#include "Impl/AlgorithmRSA.h"
#include "Impl/AlgorithmSHA1.h"
#include "Impl/AlgorithmSalsa20.h"
#include "Impl/AlgorithmSHA256.h"
std::unique_ptr<IHashFunction> Crypto::CreateSHA1()
{
return std::make_unique<AlgorithmSHA1>();
}
std::unique_ptr<IHashFunction> Crypto::CreateSHA256()
{
return std::make_unique<AlgorithmSHA256>();
}
std::unique_ptr<IStreamCipher> Crypto::CreateSalsa20(const uint8_t* keyBytes, const size_t keySize)
{
return std::make_unique<AlgorithmSalsa20>(keyBytes, keySize);
}
std::unique_ptr<IPublicKeyAlgorithm> Crypto::CreateRSA(const IPublicKeyAlgorithm::HashingAlgorithm hashingAlgorithm, const RSAPaddingMode paddingMode)
{
return std::make_unique<AlgorithmRSA>(hashingAlgorithm, paddingMode);
}