SHA2 utilities. More...

Modules

Types
SHA2 data types.
 

Functions

void sha2_starts (sha2_context_t *ctx, int32_t is224)
 SHA-256 context setup. More...
 
void sha2_update (sha2_context_t *ctx, const unsigned char *input, uint32_t ilen)
 SHA-256 process buffer. More...
 
void sha2_finish (sha2_context_t *ctx, unsigned char output[32])
 SHA-256 final digest. More...
 
void sha2 (const unsigned char *input, uint32_t ilen, unsigned char output[32], int32_t is224)
 Output = SHA-256( input buffer ) More...
 
void sha2_hmac_starts (sha2_context_t *ctx, const unsigned char *key, uint32_t keylen, int32_t is224)
 SHA-256 HMAC context setup. More...
 
void sha2_hmac_update (sha2_context_t *ctx, const unsigned char *input, uint32_t ilen)
 SHA-256 HMAC process buffer. More...
 
void sha2_hmac_finish (sha2_context_t *ctx, unsigned char output[32])
 SHA-256 HMAC final digest. More...
 
void sha2_hmac (const zos_buffer_t *key, const zos_buffer_t *input, unsigned char output[32], int32_t is224)
 Output = HMAC-SHA-256( hmac key, input buffer ) More...
 

Detailed Description

SHA2 utilities.

Function Documentation

void sha2 ( const unsigned char *  input,
uint32_t  ilen,
unsigned char  output[32],
int32_t  is224 
)

Output = SHA-256( input buffer )

Parameters
inputbuffer holding the data
ilenlength of the input data
outputSHA-224/256 checksum result
is2240 = use SHA256, 1 = use SHA224
void sha2_finish ( sha2_context_t ctx,
unsigned char  output[32] 
)

SHA-256 final digest.

Parameters
ctxSHA-256 context
outputSHA-224/256 checksum result
void sha2_hmac ( const zos_buffer_t key,
const zos_buffer_t input,
unsigned char  output[32],
int32_t  is224 
)

Output = HMAC-SHA-256( hmac key, input buffer )

Parameters
keyHMAC secret key
inputbuffer holding the data
outputHMAC-SHA-224/256 result
is2240 = use SHA256, 1 = use SHA224
void sha2_hmac_finish ( sha2_context_t ctx,
unsigned char  output[32] 
)

SHA-256 HMAC final digest.

Parameters
ctxHMAC context
outputSHA-224/256 HMAC checksum result
void sha2_hmac_starts ( sha2_context_t ctx,
const unsigned char *  key,
uint32_t  keylen,
int32_t  is224 
)

SHA-256 HMAC context setup.

Parameters
ctxHMAC context to be initialized
keyHMAC secret key
keylenlength of the HMAC key
is2240 = use SHA256, 1 = use SHA224
void sha2_hmac_update ( sha2_context_t ctx,
const unsigned char *  input,
uint32_t  ilen 
)

SHA-256 HMAC process buffer.

Parameters
ctxHMAC context
inputbuffer holding the data
ilenlength of the input data
void sha2_starts ( sha2_context_t ctx,
int32_t  is224 
)

SHA-256 context setup.

Parameters
ctxcontext to be initialized
is2240 = use SHA256, 1 = use SHA224
void sha2_update ( sha2_context_t ctx,
const unsigned char *  input,
uint32_t  ilen 
)

SHA-256 process buffer.

Parameters
ctxSHA-256 context
inputbuffer holding the data
ilenlength of the input data