43 lines
913 B
C++
43 lines
913 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Crypto.cpp
|
|
Date: 2021-6-17
|
|
Author: Reece
|
|
***/
|
|
#include <RuntimeInternal.hpp>
|
|
#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();
|
|
}
|
|
} |