Reece Wilson
8a2947ffc5
[*] Refactor bcrypt api: HashPW[Ex] -> HashPassword[Ex] [+] ByteBuffer::GetOrAllocateLinearWriteable [+] ByteBuffer::Can[Read/Write](n) [+] ByteBuffer::GetLinear[Read/Writable]able(n) [*] Split RNG.cpp into two files [+] EHashType::eSHA2_48 (_32, _64 was already in place. missed 48/384 bit) [+] AuCrypto::HMAC and IHMACContext (AuHashing) [+] EHashType::eSHA3_28 [+] EHashType::eSHA3_32 [+] EHashType::eSHA3_48 [+] EHashType::eSHA3_64 (AuCrypto) [+] EHashType::eSHA2_48_384 [+] EHashType::eSHA2_64_512 [+] EHashType::eSHA3_28_224 [+] EHashType::eSHA3_32_256 [+] EHashType::eSHA3_48_384 [+] EHashType::eSHA3_64_512 [*] (IRandomDevice) class -> struct [*] Bugfix: cast in Promise<SuccessValue_t, ErrorValue_t>::WriteIntoError [+] Missing AuHashing namespace alias [*] Time util: pad ms when fraction of a second to 3 digits
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Crypto.cpp
|
|
Date: 2021-6-17
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "AuCrypto.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);
|
|
gHashSha384 = register_hash(&sha384_desc);
|
|
gHashSha512 = register_hash(&sha512_desc);
|
|
gHashSha3_224 = register_hash(&sha3_224_desc);
|
|
gHashSha3_256 = register_hash(&sha3_256_desc);
|
|
gHashSha3_384 = register_hash(&sha3_384_desc);
|
|
gHashSha3_512 = register_hash(&sha3_512_desc);
|
|
gHashMD5 = register_hash(&md5_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();
|
|
}
|
|
} |