LDL  0.5.0
Function List
Default Cryptography

Description

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.

Function List

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)
 

Functions

◆ LDL_AES_init()

void LDL_AES_init ( struct ldl_aes_ctx ctx,
const void *  key 
)

Initialise AES block cipher

Parameters
[in]ctx
[in]keypointer 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]ctxstate previously initialised by LDL_AES_init()
[in]spointer 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]ctxstate previously initialised by LDL_AES_init()
[in]spointer to 16 byte block of data (any alignment)

◆ LDL_CMAC_init()

void LDL_CMAC_init ( struct ldl_cmac_ctx ctx,
const struct ldl_aes_ctx aes_ctx 
)

Initialise CMAC state

Parameters
[in]ctx
[in]aes_ctxblock cipher state

◆ LDL_CMAC_update()

void LDL_CMAC_update ( struct ldl_cmac_ctx ctx,
const void *  data,
uint8_t  len 
)

Update CMAC state

Parameters
[in]ctx
[in]data
[in]len

◆ 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]ctxldl_aes_ctx
[in]iv16 byte initial value
[in]ininput buffer to encrypt
[out]outoutput buffer (can be same as in)
[in]lensize of input

Data Structure Documentation

◆ ldl_aes_ctx

struct ldl_aes_ctx

AES state

◆ ldl_cmac_ctx

struct ldl_cmac_ctx

CMAC state