Authentication-Cipher Context Object Operations
[Object-Manipulation Operations]

Functions

void fsl_shw_acco_init (fsl_shw_acco_t *auth_object, fsl_shw_acc_mode_t mode)
void fsl_shw_acco_set_flags (fsl_shw_acco_t *auth_object, uint32_t flags)
void fsl_shw_acco_clear_flags (fsl_shw_acco_t *auth_object, uint32_t flags)
void fsl_shw_acco_set_ccm (fsl_shw_acco_t *auth_object, fsl_shw_key_alg_t algorithm, const uint8_t *ctr, uint8_t mac_length)
void fsl_shw_ccm_nist_format_ctr_and_iv (fsl_shw_acco_t *auth_object, uint8_t t_length, uint32_t ad_length, uint8_t q_length, const uint8_t *n, uint32_t q)
void fsl_shw_ccm_nist_update_ctr_and_iv (fsl_shw_acco_t *auth_object, const uint8_t *n, uint32_t q)

Detailed Description

These functions operate on a fsl_shw_acco_t. Their purpose is to set flags, fields, etc., in order to control the operation of fsl_shw_gen_encrypt() and fsl_shw_auth_decrypt().


Function Documentation

void fsl_shw_acco_clear_flags ( fsl_shw_acco_t auth_object,
uint32_t  flags 
)

Clear some flags in a Authentication-Cipher Context Object.

Turns off the flags specified in flags. Other flags are untouched.

Parameters:
auth_object Pointer to object to operate on.
flags The flags to reset (one or more from fsl_shw_auth_ctx_flags_t ORed together).
void fsl_shw_acco_init ( fsl_shw_acco_t auth_object,
fsl_shw_acc_mode_t  mode 
)

Initialize a Authentication-Cipher Context.

Parameters:
auth_object Pointer to object to operate on.
mode The mode for this object (only FSL_ACC_MODE_CCM supported).
void fsl_shw_acco_set_ccm ( fsl_shw_acco_t auth_object,
fsl_shw_key_alg_t  algorithm,
const uint8_t *  ctr,
uint8_t  mac_length 
)

Set up the Authentication-Cipher Object for CCM mode.

This will set the auth_object for CCM mode and save the ctr, and mac_length. This function can be called instead of fsl_shw_acco_init().

The parameter ctr is Counter Block 0, (counter value 0), which is for the MAC.

Parameters:
auth_object Pointer to object to operate on.
algorithm Cipher algorithm. Only AES is supported.
ctr The initial counter value.
mac_length The number of octets used for the MAC. Valid values are 4, 6, 8, 10, 12, 14, and 16.
void fsl_shw_acco_set_flags ( fsl_shw_acco_t auth_object,
uint32_t  flags 
)

Set the flags for a Authentication-Cipher Context.

Turns on the flags specified in flags. Other flags are untouched.

Parameters:
auth_object Pointer to object to operate on.
flags The flags to set (one or more from fsl_shw_auth_ctx_flags_t ORed together).
void fsl_shw_ccm_nist_format_ctr_and_iv ( fsl_shw_acco_t auth_object,
uint8_t  t_length,
uint32_t  ad_length,
uint8_t  q_length,
const uint8_t *  n,
uint32_t  q 
)

Format the First Block (IV) & Initial Counter Value per NIST CCM.

This function will also set the IV and CTR values per Appendix A of NIST Special Publication 800-38C (May 2004). It will also perform the fsl_shw_acco_set_ccm() operation with information derived from this set of parameters.

Note this function assumes the algorithm is AES. It initializes the auth_object by setting the mode to FSL_ACC_MODE_CCM and setting the flags to be FSL_ACCO_NIST_CCM.

Parameters:
auth_object Pointer to object to operate on.
t_length The number of octets used for the MAC. Valid values are 4, 6, 8, 10, 12, 14, and 16.
ad_length Number of octets of Associated Data (may be zero).
q_length A value for the size of the length of q field. Valid values are 1-8.
n The Nonce (packet number or other changing value). Must be (15 - q_length) octets long.
q The value of Q (size of the payload in octets).
void fsl_shw_ccm_nist_update_ctr_and_iv ( fsl_shw_acco_t auth_object,
const uint8_t *  n,
uint32_t  q 
)

Update the First Block (IV) & Initial Counter Value per NIST CCM.

This function will set the IV and CTR values per Appendix A of NIST Special Publication 800-38C (May 2004).

Note this function assumes that fsl_shw_ccm_nist_format_ctr_and_iv() has previously been called on the auth_object.

Parameters:
auth_object Pointer to object to operate on.
n The Nonce (packet number or other changing value). Must be (15 - q_length) octets long.
q The value of Q (size of the payload in octets).
footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen