Split mbedtls_ccm_init() -> setkey()

This commit is contained in:
Manuel Pégourié-Gonnard 2015-04-28 18:02:54 +02:00
parent d54e617ea6
commit 6963ff0969
7 changed files with 50 additions and 17 deletions

View file

@ -41,6 +41,15 @@ typedef struct {
}
mbedtls_ccm_context;
/**
* \brief Initialize CCM context (just makes references valid)
* Makes the context ready for mbedtls_ccm_setkey() or
* mbedtls_ccm_free().
*
* \param ctx CCM context to initialize
*/
void mbedtls_ccm_init( mbedtls_ccm_context *ctx );
/**
* \brief CCM initialization (encryption and decryption)
*
@ -51,8 +60,10 @@ mbedtls_ccm_context;
*
* \return 0 if successful, or a cipher specific error code
*/
int mbedtls_ccm_init( mbedtls_ccm_context *ctx, mbedtls_cipher_id_t cipher,
const unsigned char *key, unsigned int keysize );
int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx,
mbedtls_cipher_id_t cipher,
const unsigned char *key,
unsigned int keysize );
/**
* \brief Free a CCM context and underlying cipher sub-context