27 #ifndef POLARSSL_SHA2_H
28 #define POLARSSL_SHA2_H
36 typedef UINT32 uint32_t;
41 #define POLARSSL_ERR_SHA2_FILE_IO_ERROR -0x0078
43 #if !defined(POLARSSL_SHA2_ALT)
54 unsigned char buffer[64];
56 unsigned char ipad[64];
57 unsigned char opad[64];
114 void sha2(
const unsigned char *input,
size_t ilen,
115 unsigned char output[32],
int is224 );
126 int sha2_file(
const char *path,
unsigned char output[32],
int is224 );
173 void sha2_hmac(
const unsigned char *key,
size_t keylen,
174 const unsigned char *input,
size_t ilen,
175 unsigned char output[32],
int is224 );
void sha2_hmac_update(sha2_context *ctx, const unsigned char *input, size_t ilen)
SHA-256 HMAC process buffer.
SHA-256 context structure.
void sha2_hmac_starts(sha2_context *ctx, const unsigned char *key, size_t keylen, int is224)
SHA-256 HMAC context setup.
Configuration options (set of defines)
void sha2_hmac_reset(sha2_context *ctx)
SHA-256 HMAC context reset.
void sha2_hmac_finish(sha2_context *ctx, unsigned char output[32])
SHA-256 HMAC final digest.
int sha2_self_test(int verbose)
Checkup routine.
void sha2_update(sha2_context *ctx, const unsigned char *input, size_t ilen)
SHA-256 process buffer.
void sha2_process(sha2_context *ctx, const unsigned char data[64])
void sha2_hmac(const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
Output = HMAC-SHA-256( hmac key, input buffer )
int sha2_file(const char *path, unsigned char output[32], int is224)
Output = SHA-256( file contents )
void sha2(const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
Output = SHA-256( input buffer )
void sha2_starts(sha2_context *ctx, int is224)
SHA-256 context setup.
void sha2_finish(sha2_context *ctx, unsigned char output[32])
SHA-256 final digest.