AuroraRuntime/Source/Crypto.cpp

43 lines
920 B
C++
Raw Normal View History

2021-06-27 21:25:29 +00:00
/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: Crypto.cpp
Date: 2021-6-17
Author: Reece
***/
2021-09-30 14:57:41 +00:00
#include <Source/RuntimeInternal.hpp>
2021-06-27 21:25:29 +00:00
#include "Crypto.hpp"
#include <tomcrypt.h>
namespace Crypto
{
static prng_state gPrng;
static void TomCryptInit()
{
crypt_mp_init("ltm");
yarrow_start(&gPrng);
gHashTiger = register_hash(&tiger_desc);
register_hash(&md5_desc);
gHashSha1 = register_hash(&sha1_desc);
gHashSha256 = register_hash(&sha256_desc);
gHashSha512 = register_hash(&sha512_desc);
register_hash(&rmd128_desc);
register_hash(&rmd160_desc);
gPrngYarrow = register_prng(&yarrow_desc);
gAesCipher = register_cipher(&aes_desc);
}
static void MBedTlsInit()
{
}
void InitCrypto()
{
TomCryptInit();
MBedTlsInit();
}
}