// Main include
#include "Client.h"

// Defines
#define SHA512_DIGEST_SIZE ( 512 / 8)
#define SHA512_BLOCK_SIZE  (1024 / 8)

// Define sha types
#ifndef SHA2_TYPES
#define SHA2_TYPES
typedef unsigned char uint8;
typedef unsigned int  uint32;
typedef unsigned long long uint64;
#endif

// In case of C++
#ifdef __cplusplus
extern "C" {
#endif

	// SHA struct
	typedef struct
	{
		unsigned int tot_len;
		unsigned int len;
		unsigned char block[2 * SHA512_BLOCK_SIZE];
		uint64 h[8];
	}
	sha512_ctx;
	typedef sha512_ctx sha384_ctx;

	// Define functions
	void sha512_init(sha512_ctx *ctx);
	void sha512_update(sha512_ctx *ctx, const unsigned char *message, unsigned int len);
	void sha512_final(sha512_ctx *ctx, unsigned char *digest);
	void sha512(const unsigned char *message, unsigned int len, unsigned char *digest);
}

// Main crypt function
char *function_crypt_sha512(const char *normal_password);
