Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

fsl_shw_return_t fsl_shw_auth_decrypt ( fsl_shw_uco_t user_ctx,
fsl_shw_acco_t auth_ctx,
fsl_shw_sko_t cipher_key_info,
fsl_shw_sko_t auth_key_info,
uint32_t  auth_data_length,
const uint8_t *  auth_data,
uint32_t  payload_length,
const uint8_t *  ct,
const uint8_t *  auth_value,
uint8_t *  payload 

Authenticate and decrypt a (CCM) stream.

Perform Authentication-Decryption in Cipher + Hash.

This function will perform a one-shot decryption of a data stream as well as authenticate the authentication value. This is a one-shot function, so all of the auth_data and the total message payload must passed in one call. This also means that the flags in the auth_ctx must be FSL_ACCO_CTX_INIT and FSL_ACCO_CTX_FINALIZE.

user_ctx A user context from fsl_shw_register_user().
auth_ctx Controlling object for Authenticate-decrypt.
cipher_key_info The key being used for the cipher part of this operation. In CCM mode, this key is used for both parts.
auth_key_info The key being used for the authentication part of this operation. In CCM mode, this key is ignored and may be NULL.
auth_data_length Length, in octets, of auth_data.
auth_data Data to be authenticated but not decrypted.
payload_length Length, in octets, of ct and pt.
ct Pointer to the encrypted input stream.
auth_value The (encrypted) authentication value which will be authenticated. This is the same data as the (output) auth_value argument to fsl_shw_gen_encrypt().
[out] payload Pointer to where the plaintext resulting from the decryption will be stored.
A return code of type fsl_shw_return_t.
user_ctx The user's context
auth_ctx Info on this Auth operation
cipher_key_info Key to encrypt payload
auth_key_info (unused - same key in CCM)
auth_data_length Length in bytes of auth_data
auth_data Any auth-only data
payload_length Length in bytes of payload
ct The encrypted data
auth_value The authentication code to validate
[out] payload The location to store decrypted data
A return code of type fsl_shw_return_t.

Definition at line 2214 of file shw_driver.c.

      volatile fsl_shw_return_t status = FSL_RETURN_ERROR_S;

      /* Unused */
      (void)auth_key_info;    /* save compilation warning */

      return status;

Generated by  Doxygen 1.6.0   Back to index