#include <stdint.h>
#include <openssl/hmac.h>
#include <crypto/hmac.h>
Go to the source code of this file.
|
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. More...
|
|
void | hmac_sha1 (uint8_t *key, int32_t key_length, const uint8_t *data_chunks[], uint32_t data_chunck_length[], uint8_t *mac, int32_t *mac_length) |
| Compute SHA1 HMAC over several data cunks. More...
|
|
void * | createSha1HmacContext (uint8_t *key, int32_t key_length) |
| 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) |
| Compute SHA1 HMAC. More...
|
|
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...
|
|
void | freeSha1HmacContext (void *ctx) |
| Free SHA1 HMAC context. More...
|
|
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 67 of file hmac.cpp.
void freeSha1HmacContext |
( |
void * |
ctx | ) |
|
Free SHA1 HMAC context.
- Parameters
-
ctx | a pointer to SHA1 HMAC context |
Definition at line 100 of file hmac.cpp.
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.
This functions takes one data chunk and computes its SHA1 HMAC.
- Parameters
-
key | The MAC key. |
key_length | Lneght of the MAC key in bytes |
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 42 of file hmac.cpp.
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 51 of file hmac.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 76 of file hmac.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 86 of file hmac.cpp.