New ndpi_sha256() nDPI API call (#2230)

* Added ndpi_sha256.c to the Windows project

* Added ndpi_sha256() nDPI API call
This commit is contained in:
Luca Deri
2023-12-23 10:47:28 +01:00
committed by GitHub
parent f2be972224
commit 99d4838328
6 changed files with 27 additions and 17 deletions
+6 -5
View File
@@ -14,7 +14,8 @@
#include "ndpi_typedefs.h"
/****************************** MACROS ******************************/
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
#define NDPI_SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
/**************************** DATA TYPES ****************************/
@@ -23,12 +24,12 @@ typedef struct {
u_int32_t datalen;
unsigned long long bitlen;
u_int32_t state[8];
} SHA256_CTX;
} ndpi_SHA256_CTX;
/*********************** FUNCTION DECLARATIONS **********************/
void ndpi_sha256_init(SHA256_CTX *ctx);
void ndpi_sha256_update(SHA256_CTX *ctx, const u_int8_t data[], size_t len);
void ndpi_sha256_final(SHA256_CTX *ctx, u_int8_t hash[]);
void ndpi_sha256_init(ndpi_SHA256_CTX *ctx);
void ndpi_sha256_update(ndpi_SHA256_CTX *ctx, const u_int8_t data[], size_t len);
void ndpi_sha256_final(ndpi_SHA256_CTX *ctx, u_int8_t hash[]);
#endif // SHA256_H