The implementations for these interfaces are used by the default Security Module. They are documented here to assist integrators that choose to reimplement Security Module.
These implementations are provided for the purpose of evaluating LDL and no effort has been made to ensure they are hardened against attacks.
|
| void | LDL_AES_init (struct ldl_aes_ctx *ctx, const void *key) |
| |
| void | LDL_AES_encrypt (const struct ldl_aes_ctx *ctx, void *s) |
| |
| void | LDL_AES_decrypt (const struct ldl_aes_ctx *ctx, void *s) |
| |
| void | LDL_CMAC_init (struct ldl_cmac_ctx *ctx, const struct ldl_aes_ctx *aes_ctx) |
| |
| void | LDL_CMAC_update (struct ldl_cmac_ctx *ctx, const void *data, uint8_t len) |
| |
| void | LDL_CMAC_finish (const struct ldl_cmac_ctx *ctx, void *out, uint8_t outMax) |
| |
| void | LDL_CTR_encrypt (struct ldl_aes_ctx *ctx, const void *iv, const void *in, void *out, uint8_t len) |
| |
◆ LDL_AES_init()
| void LDL_AES_init |
( |
struct ldl_aes_ctx * |
ctx, |
|
|
const void * |
key |
|
) |
| |
Initialise AES block cipher
- Parameters
-
| [in] | ctx | |
| [in] | key | pointer to 16 byte key |
◆ LDL_AES_encrypt()
| void LDL_AES_encrypt |
( |
const struct ldl_aes_ctx * |
ctx, |
|
|
void * |
s |
|
) |
| |
Encrypt a block of data
- Parameters
-
| [in] | ctx | state previously initialised by LDL_AES_init() |
| [in] | s | pointer to 16 byte block of data (any alignment) |
◆ LDL_AES_decrypt()
| void LDL_AES_decrypt |
( |
const struct ldl_aes_ctx * |
ctx, |
|
|
void * |
s |
|
) |
| |
Decrypt a block of data
- Parameters
-
| [in] | ctx | state previously initialised by LDL_AES_init() |
| [in] | s | pointer to 16 byte block of data (any alignment) |
◆ LDL_CMAC_init()
Initialise CMAC state
- Parameters
-
| [in] | ctx | |
| [in] | aes_ctx | block cipher state |
◆ LDL_CMAC_update()
| void LDL_CMAC_update |
( |
struct ldl_cmac_ctx * |
ctx, |
|
|
const void * |
data, |
|
|
uint8_t |
len |
|
) |
| |
Update CMAC state
- Parameters
-
◆ LDL_CMAC_finish()
| void LDL_CMAC_finish |
( |
const struct ldl_cmac_ctx * |
ctx, |
|
|
void * |
out, |
|
|
uint8_t |
outMax |
|
) |
| |
Produce CMAC output from current state
- Parameters
-
| [in] | ctx | |
| [out] | out | |
| [in] | outMax | |
◆ LDL_CTR_encrypt()
| void LDL_CTR_encrypt |
( |
struct ldl_aes_ctx * |
ctx, |
|
|
const void * |
iv, |
|
|
const void * |
in, |
|
|
void * |
out, |
|
|
uint8_t |
len |
|
) |
| |
Counter mode encryption
- Parameters
-
| [in] | ctx | ldl_aes_ctx |
| [in] | iv | 16 byte initial value |
| [in] | in | input buffer to encrypt |
| [out] | out | output buffer (can be same as in) |
| [in] | len | size of input |
◆ ldl_aes_ctx
◆ ldl_cmac_ctx