1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-22 11:13:21 +00:00

Much improved, better stability, lots of fixes

This commit is contained in:
Ylian Saint-Hilaire
2018-01-12 11:50:04 -08:00
parent becf71557f
commit 508646044e
69 changed files with 11803 additions and 4088 deletions

View File

@@ -35,18 +35,31 @@ BOOL util_CopyFile(_In_ LPCSTR lpExistingFileName, _In_ LPCSTR lpNewFileName, _I
void __fastcall util_random(int length, char* result);
void __fastcall util_randomtext(int length, char* result);
#define UTIL_HASHSIZE 48
#define NONCE_SIZE 48
#define UTIL_MD5_HASHSIZE 16
#define UTIL_SHA1_HASHSIZE 20
#define UTIL_SHA256_HASHSIZE 32
#define UTIL_SHA384_HASHSIZE 48
#define UTIL_SHA512_HASHSIZE 64
#ifdef MICROSTACK_NOTLS
#include "md5.h"
#include "sha1.h"
#include "microstack/SHA256.h"
#include "microstack/SHA.h"
#define SHA256_CTX struct sha256_ctx
#define SHA256_Init(ctx) __sha256_init_ctx(ctx)
#define SHA256_Update(ctx, data, len) __sha256_process_bytes(data, len, ctx)
#define SHA256_Final(md, ctx) __sha256_finish_ctx(ctx, md)
#define SHA256_CTX SHA256Context
#define SHA512_CTX SHA512Context
#define SHA256_Init(ctx) SHA256Reset (ctx)
#define SHA256_Update(ctx, data, len) SHA256Input(ctx, (uint8_t*)data, len)
#define SHA256_Final(md, ctx) SHA256Result (ctx, md)
#define SHA384_Init(ctx) SHA384Reset (ctx)
#define SHA384_Update(ctx, data, len) SHA384Input(ctx, (uint8_t*)data, len)
#define SHA384_Final(md, ctx) SHA384Result (ctx, md)
#define SHA512_Init(ctx) SHA512Reset (ctx)
#define SHA512_Update(ctx, data, len) SHA512Input(ctx, (uint8_t*)data, len)
#define SHA512_Final(md, ctx) SHA512Result (ctx, md)
#endif