1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Split mbedtls_gcm_init() -> gcm_setkey()

This commit is contained in:
Manuel Pégourié-Gonnard
2015-04-28 21:42:17 +02:00
parent 6963ff0969
commit c34e8dd265
6 changed files with 43 additions and 13 deletions

View File

@ -54,6 +54,15 @@ typedef struct {
}
mbedtls_gcm_context;
/**
* \brief Initialize GCM context (just makes references valid)
* Makes the context ready for mbedtls_gcm_setkey() or
* mbedtls_gcm_free().
*
* \param ctx GCM context to initialize
*/
void mbedtls_gcm_init( mbedtls_gcm_context *ctx );
/**
* \brief GCM initialization (encryption)
*
@ -64,8 +73,10 @@ mbedtls_gcm_context;
*
* \return 0 if successful, or a cipher specific error code
*/
int mbedtls_gcm_init( mbedtls_gcm_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key,
unsigned int keysize );
int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx,
mbedtls_cipher_id_t cipher,
const unsigned char *key,
unsigned int keysize );
/**
* \brief GCM buffer encryption/decryption using a block cipher