Symmetric Cipher Context Operations
[Object-Manipulation Operations]

Functions

void fsl_shw_scco_init (fsl_shw_scco_t *sym_ctx, fsl_shw_key_alg_t algorithm, fsl_shw_sym_mode_t mode)
void fsl_shw_scco_set_flags (fsl_shw_scco_t *sym_ctx, uint32_t flags)
void fsl_shw_scco_clear_flags (fsl_shw_scco_t *sym_ctx, uint32_t flags)
void fsl_shw_scco_set_context (fsl_shw_scco_t *sym_ctx, uint8_t *context)
void fsl_shw_scco_get_context (const fsl_shw_scco_t *sym_ctx, uint8_t *context)
void fsl_shw_scco_set_counter_info (fsl_shw_scco_t *sym_ctx, const uint8_t *counter, fsl_shw_ctr_mod_t modulus)
void fsl_shw_scco_get_counter_info (const fsl_shw_scco_t *sym_ctx, uint8_t *counter, fsl_shw_ctr_mod_t *modulus)

Detailed Description

These operations should be the only access to the fsl_shw_scco_t type/struct, as the internal members of that object are subject to change


Function Documentation

void fsl_shw_scco_clear_flags ( fsl_shw_scco_t sym_ctx,
uint32_t  flags 
)

Clear some flags in a Symmetric Cipher Context Object.

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

Parameters:
sym_ctx The context object to operate on.
flags The flags to reset (one or more values from fsl_shw_sym_ctx_flags_t ORed together).
void fsl_shw_scco_get_context ( const fsl_shw_scco_t sym_ctx,
uint8_t *  context 
)

Get the Context for a Symmetric Cipher Context.

This is to retrieve the context/IV for FSL_SYM_MODE_CBC mode, or to retrieve context (the S-Box and pointers) for ARC4. The full context will be copied.

Parameters:
sym_ctx The context object to operate on.
[out] context Pointer to location where context will be stored.
void fsl_shw_scco_get_counter_info ( const fsl_shw_scco_t sym_ctx,
uint8_t *  counter,
fsl_shw_ctr_mod_t modulus 
)

Get the Counter Value for a Symmetric Cipher Context.

This will retrieve the Counter Value is for CTR mode.

Parameters:
sym_ctx The context object to query.
[out] counter Pointer to location to store the current counter value. The number of octets copied will be the block size for the algorithm.
[out] modulus Pointer to location to store the modulus.
void fsl_shw_scco_init ( fsl_shw_scco_t sym_ctx,
fsl_shw_key_alg_t  algorithm,
fsl_shw_sym_mode_t  mode 
)

Initialize a Symmetric Cipher Context Object.

This function must be called before performing any other operation with the Object. This will set the mode and algorithm and initialize the Object.

Parameters:
sym_ctx The context object to operate on.
algorithm The cipher algorithm this context will be used with.
mode FSL_SYM_MODE_CBC, FSL_SYM_MODE_ECB, etc.
void fsl_shw_scco_set_context ( fsl_shw_scco_t sym_ctx,
uint8_t *  context 
)

Set the Context (IV) for a Symmetric Cipher Context.

This is to set the context/IV for FSL_SYM_MODE_CBC mode, or to set the context (the S-Box and pointers) for ARC4. The full context size will be copied.

Parameters:
sym_ctx The context object to operate on.
context A pointer to the buffer which contains the context.
void fsl_shw_scco_set_counter_info ( fsl_shw_scco_t sym_ctx,
const uint8_t *  counter,
fsl_shw_ctr_mod_t  modulus 
)

Set the Counter Value for a Symmetric Cipher Context.

This will set the Counter Value for CTR mode.

Parameters:
sym_ctx The context object to operate on.
counter The starting counter value. The number of octets. copied will be the block size for the algorithm.
modulus The modulus for controlling the incrementing of the counter.
void fsl_shw_scco_set_flags ( fsl_shw_scco_t sym_ctx,
uint32_t  flags 
)

Set the flags for a Symmetric Cipher Context.

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

Parameters:
sym_ctx The context object to operate on.
flags The flags to reset (one or more values from fsl_shw_sym_ctx_flags_t ORed together).
footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen