27 #ifndef POLARSSL_SHA512_H
28 #define POLARSSL_SHA512_H
30 #if !defined(POLARSSL_CONFIG_FILE)
33 #include POLARSSL_CONFIG_FILE
38 #if defined(_MSC_VER) || defined(__WATCOMC__)
39 #define UL64(x) x##ui64
40 typedef unsigned __int64 uint64_t;
43 #define UL64(x) x##ULL
46 #define POLARSSL_ERR_SHA512_FILE_IO_ERROR -0x007A
48 #if !defined(POLARSSL_SHA512_ALT)
63 unsigned char buffer[128];
65 unsigned char ipad[128];
66 unsigned char opad[128];
116 #include "sha512_alt.h"
131 void sha512(
const unsigned char *input,
size_t ilen,
132 unsigned char output[64],
int is384 );
143 int sha512_file(
const char *path,
unsigned char output[64],
int is384 );
154 size_t keylen,
int is384 );
191 void sha512_hmac(
const unsigned char *key,
size_t keylen,
192 const unsigned char *input,
size_t ilen,
193 unsigned char output[64],
int is384 );
void sha512_hmac_update(sha512_context *ctx, const unsigned char *input, size_t ilen)
SHA-512 HMAC process buffer.
Configuration options (set of defines)
void sha512_process(sha512_context *ctx, const unsigned char data[128])
SHA-512 context structure.
void sha512_hmac_finish(sha512_context *ctx, unsigned char output[64])
SHA-512 HMAC final digest.
void sha512_starts(sha512_context *ctx, int is384)
SHA-512 context setup.
int sha512_self_test(int verbose)
Checkup routine.
void sha512(const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
Output = SHA-512( input buffer )
int sha512_file(const char *path, unsigned char output[64], int is384)
Output = SHA-512( file contents )
void sha512_hmac(const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
Output = HMAC-SHA-512( hmac key, input buffer )
void sha512_finish(sha512_context *ctx, unsigned char output[64])
SHA-512 final digest.
void sha512_hmac_starts(sha512_context *ctx, const unsigned char *key, size_t keylen, int is384)
SHA-512 HMAC context setup.
void sha512_hmac_reset(sha512_context *ctx)
SHA-512 HMAC context reset.
void sha512_free(sha512_context *ctx)
Clear SHA-512 context.
void sha512_update(sha512_context *ctx, const unsigned char *input, size_t ilen)
SHA-512 process buffer.
void sha512_init(sha512_context *ctx)
Initialize SHA-512 context.