SHA2 utilities. More...

Modules

Types
SHA2 data types.
 

Functions

void gos_sha256_starts (gos_sha256_context_t *ctx, int32_t is224)
 SHA-256 context setup. More...
 
void gos_sha256_update (gos_sha256_context_t *ctx, const unsigned char *input, uint32_t ilen)
 SHA-256 process buffer. More...
 
void gos_sha256_finish (gos_sha256_context_t *ctx, unsigned char output[32])
 SHA-256 final digest. More...
 
void gos_sha256 (const unsigned char *input, uint32_t ilen, unsigned char output[32], int32_t is224)
 Output = SHA-256( input buffer ) More...
 
void gos_sha256_hmac_starts (gos_sha256_hmac_context_t *ctx, const unsigned char *key, uint32_t keylen, int32_t is224)
 SHA-256 HMAC context setup. More...
 
void gos_sha256_hmac_update (gos_sha256_hmac_context_t *ctx, const unsigned char *input, uint32_t ilen)
 SHA-256 HMAC process buffer. More...
 
void gos_sha256_hmac_finish (gos_sha256_hmac_context_t *ctx, unsigned char output[32])
 SHA-256 HMAC final digest. More...
 
void gos_sha256_hmac (const unsigned char *key, uint32_t keylen, const unsigned char *input, uint32_t ilen, unsigned char output[32], int32_t is224)
 Output = HMAC-SHA-256( hmac key, input buffer ) More...
 

Detailed Description

SHA2 utilities.

Function Documentation

◆ gos_sha256()

void gos_sha256 ( 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

◆ gos_sha256_finish()

void gos_sha256_finish ( gos_sha256_context_t ctx,
unsigned char  output[32] 
)

SHA-256 final digest.

Parameters
ctxSHA-256 context
outputSHA-224/256 checksum result

◆ gos_sha256_hmac()

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

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

Parameters
keyHMAC secret key
keylenLength of key
inputbuffer holding the data
ilenLength of input buffer
outputHMAC-SHA-224/256 result
is2240 = use SHA256, 1 = use SHA224

◆ gos_sha256_hmac_finish()

void gos_sha256_hmac_finish ( gos_sha256_hmac_context_t ctx,
unsigned char  output[32] 
)

SHA-256 HMAC final digest.

Parameters
ctxHMAC context
outputSHA-224/256 HMAC checksum result

◆ gos_sha256_hmac_starts()

void gos_sha256_hmac_starts ( gos_sha256_hmac_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

◆ gos_sha256_hmac_update()

void gos_sha256_hmac_update ( gos_sha256_hmac_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

◆ gos_sha256_starts()

void gos_sha256_starts ( gos_sha256_context_t ctx,
int32_t  is224 
)

SHA-256 context setup.

Parameters
ctxcontext to be initialized
is2240 = use SHA256, 1 = use SHA224

◆ gos_sha256_update()

void gos_sha256_update ( gos_sha256_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