1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-11-03 07:47:18 +01:00

Rename source to module.

This commit is contained in:
Sandu Liviu Catalin
2020-03-21 23:02:27 +02:00
parent a5c87bae5e
commit c0fd374404
237 changed files with 0 additions and 272718 deletions

30
module/Vendor/Whirlpool/include/ustd.h vendored Normal file
View File

@@ -0,0 +1,30 @@
/* ustd.h common macros and includes */
#ifndef LIBRHASH_USTD_H
#define LIBRHASH_USTD_H
#if _MSC_VER >= 1300
# define int64_t __int64
# define int32_t __int32
# define int16_t __int16
# define int8_t __int8
# define uint64_t unsigned __int64
# define uint32_t unsigned __int32
# define uint16_t unsigned __int16
# define uint8_t unsigned __int8
/* disable warnings: The POSIX name for this item is deprecated. Use the ISO C++ conformant name. */
#pragma warning(disable : 4996)
#else /* _MSC_VER >= 1300 */
# include <stdint.h>
# include <unistd.h>
#endif /* _MSC_VER >= 1300 */
#if _MSC_VER <= 1300
# include <stdlib.h> /* size_t for vc6.0 */
#endif /* _MSC_VER <= 1300 */
#endif /* LIBRHASH_USTD_H */

View File

@@ -0,0 +1,34 @@
/* whirlpool.h */
#ifndef WHIRLPOOL_H
#define WHIRLPOOL_H
#include "ustd.h"
#ifdef __cplusplus
extern "C" {
#endif
#define whirlpool_block_size 64
/* algorithm context */
typedef struct whirlpool_ctx
{
uint64_t hash[8]; /* 512-bit algorithm internal hashing state */
unsigned char message[whirlpool_block_size]; /* 512-bit buffer to hash */
/* Note: original algorith uses 256-bit counter, allowing to hash up to
2^256 bits sized message. For optimization we use here 64-bit counter,
thus reducing maximal message size to 2^64 bits = 2 Exbibytes = 2^21 TiB) */
uint64_t length; /* number of processed bytes */
} whirlpool_ctx;
/* hash functions */
void rhash_whirlpool_init(whirlpool_ctx* ctx);
void rhash_whirlpool_update(whirlpool_ctx* ctx, const unsigned char* msg, size_t size);
void rhash_whirlpool_final(whirlpool_ctx* ctx, unsigned char* result);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* WHIRLPOOL_H */