mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
Move XChunk processors to ZoneCommon
This commit is contained in:
@ -4,22 +4,22 @@
|
||||
#include "Impl/AlgorithmSalsa20.h"
|
||||
#include "Impl/AlgorithmSHA256.h"
|
||||
|
||||
IHashFunction* Crypto::CreateSHA1()
|
||||
std::unique_ptr<IHashFunction> Crypto::CreateSHA1()
|
||||
{
|
||||
return new AlgorithmSHA1();
|
||||
return std::make_unique<AlgorithmSHA1>();
|
||||
}
|
||||
|
||||
IHashFunction* Crypto::CreateSHA256()
|
||||
std::unique_ptr<IHashFunction> Crypto::CreateSHA256()
|
||||
{
|
||||
return new AlgorithmSHA256();
|
||||
return std::make_unique<AlgorithmSHA256>();
|
||||
}
|
||||
|
||||
IStreamCipher* Crypto::CreateSalsa20(const uint8_t* keyBytes, const size_t keySize)
|
||||
std::unique_ptr<IStreamCipher> Crypto::CreateSalsa20(const uint8_t* keyBytes, const size_t keySize)
|
||||
{
|
||||
return new AlgorithmSalsa20(keyBytes, keySize);
|
||||
return std::make_unique<AlgorithmSalsa20>(keyBytes, keySize);
|
||||
}
|
||||
|
||||
IPublicKeyAlgorithm* Crypto::CreateRSA(const IPublicKeyAlgorithm::HashingAlgorithm hashingAlgorithm, const RSAPaddingMode paddingMode)
|
||||
std::unique_ptr<IPublicKeyAlgorithm> Crypto::CreateRSA(const IPublicKeyAlgorithm::HashingAlgorithm hashingAlgorithm, const RSAPaddingMode paddingMode)
|
||||
{
|
||||
return new AlgorithmRSA(hashingAlgorithm, paddingMode);
|
||||
return std::make_unique<AlgorithmRSA>(hashingAlgorithm, paddingMode);
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
|
||||
#include "IHashFunction.h"
|
||||
#include "IStreamCipher.h"
|
||||
@ -15,10 +17,10 @@ public:
|
||||
RSA_PADDING_PSS,
|
||||
};
|
||||
|
||||
static IHashFunction* CreateSHA1();
|
||||
static IHashFunction* CreateSHA256();
|
||||
static std::unique_ptr<IHashFunction> CreateSHA1();
|
||||
static std::unique_ptr<IHashFunction> CreateSHA256();
|
||||
|
||||
static IStreamCipher* CreateSalsa20(const uint8_t* keyBytes, size_t keySize);
|
||||
static std::unique_ptr<IStreamCipher> CreateSalsa20(const uint8_t* keyBytes, size_t keySize);
|
||||
|
||||
static IPublicKeyAlgorithm* CreateRSA(IPublicKeyAlgorithm::HashingAlgorithm hashingAlgorithm, RSAPaddingMode paddingMode);
|
||||
static std::unique_ptr<IPublicKeyAlgorithm> CreateRSA(IPublicKeyAlgorithm::HashingAlgorithm hashingAlgorithm, RSAPaddingMode paddingMode);
|
||||
};
|
||||
|
Reference in New Issue
Block a user