Include dependency graph for gcrypthmac.cpp:
Go to the source code of this file.
Functions
void
hmac_sha1 (uint8_t *key, int32_t keyLength, const uint8_t *data, int32_t dataLength, uint8_t *mac, int32_t *macLength)
void
hmac_sha1 (uint8_t *key, int32_t keyLength, const uint8_t *dataChunks[], uint32_t dataChunkLength[], uint8_t *mac, int32_t *macLength)
Compute SHA1 HMAC over several data cunks.
More...
Create and initialize a SHA1 HMAC context.
More...
void
hmacSha1Ctx (void *ctx, const uint8_t *data, uint32_t data_length, uint8_t *mac, int32_t *mac_length)
void
hmacSha1Ctx (void *ctx, const uint8_t *data[], uint32_t data_length[], uint8_t *mac, int32_t *mac_length)
Compute SHA1 HMAC over several data cunks.
More...
Function Documentation
void* createSha1HmacContext
(
uint8_t *
key,
int32_t
key_length
)
Create and initialize a SHA1 HMAC context.
An application uses this context to create several HMAC with the same key.
- Parameters
-
key The MAC key.
key_length Lenght of the MAC key in bytes
- Returns
- Returns a pointer to the initialized context
Definition at line 70 of file gcrypthmac.cpp.
void freeSha1HmacContext
(
void *
ctx )
Free SHA1 HMAC context.
- Parameters
-
ctx a pointer to SHA1 HMAC context
Definition at line 113 of file gcrypthmac.cpp.
void hmac_sha1
(
uint8_t *
key,
int32_t
keyLength,
const uint8_t *
data,
int32_t
dataLength,
uint8_t *
mac,
int32_t *
macLength
)
void hmac_sha1
(
uint8_t *
key,
int32_t
key_length,
const uint8_t *
data[],
uint32_t
data_length[],
uint8_t *
mac,
int32_t *
mac_length
)
Compute SHA1 HMAC over several data cunks.
This functions takes several data chunk and computes the SHA1 HAMAC.
- Parameters
-
key The MAC key.
key_length Lneght of the MAC key in bytes
data Points to an array of pointers that point to the data chunks. A NULL pointer in an array element terminates the data chunks.
data_length Points to an array of integers that hold the length of each data chunk.
mac Points to a buffer that receives the computed digest. This buffer must have a size of at least 20 bytes (SHA1_DIGEST_LENGTH).
mac_length Point to an integer that receives the length of the computed HMAC.
Definition at line 47 of file gcrypthmac.cpp.
void hmacSha1Ctx
(
void *
ctx,
const uint8_t *
data,
uint32_t
data_length,
uint8_t *
mac,
int32_t *
mac_length
)
Compute SHA1 HMAC.
This functions takes one data chunk and computes its SHA1 HMAC. On return the SHA1 MAC context is ready to compute a HMAC for another data chunk.
- Parameters
-
ctx Pointer to initialized SHA1 HMAC context
data Points to the data chunk.
data_length Length of the data in bytes
mac Points to a buffer that receives the computed digest. This buffer must have a size of at least 20 bytes (SHA1_DIGEST_LENGTH).
mac_length Point to an integer that receives the length of the computed HMAC.
Definition at line 79 of file gcrypthmac.cpp.
void hmacSha1Ctx
(
void *
ctx,
const uint8_t *
data[],
uint32_t
data_length[],
uint8_t *
mac,
int32_t *
mac_length
)
Compute SHA1 HMAC over several data cunks.
This functions takes several data chunks and computes the SHA1 HAMAC. On return the SHA1 MAC context is ready to compute a HMAC for another data chunk.
- Parameters
-
ctx Pointer to initialized SHA1 HMAC context
data Points to an array of pointers that point to the data chunks. A NULL pointer in an array element terminates the data chunks.
data_length Points to an array of integers that hold the length of each data chunk.
mac Points to a buffer that receives the computed digest. This buffer must have a size of at least 20 bytes (SHA1_DIGEST_LENGTH).
mac_length Point to an integer that receives the length of the computed HMAC.
Definition at line 95 of file gcrypthmac.cpp.