30 #define MBEDTLS_GCM_ENCRYPT 1
31 #define MBEDTLS_GCM_DECRYPT 0
33 #define MBEDTLS_ERR_GCM_AUTH_FAILED -0x0012
34 #define MBEDTLS_ERR_GCM_BAD_INPUT -0x0014
49 unsigned char base_ectr[16];
51 unsigned char buf[16];
77 const unsigned char *key,
78 unsigned int keybits );
105 const unsigned char *iv,
107 const unsigned char *add,
109 const unsigned char *input,
110 unsigned char *output,
112 unsigned char *tag );
137 const unsigned char *iv,
139 const unsigned char *add,
141 const unsigned char *tag,
143 const unsigned char *input,
144 unsigned char *output );
160 const unsigned char *iv,
162 const unsigned char *add,
184 const unsigned char *input,
185 unsigned char *output );
void mbedtls_gcm_init(mbedtls_gcm_context *ctx)
Initialize GCM context (just makes references valid) Makes the context ready for mbedtls_gcm_setkey()...
int mbedtls_gcm_starts(mbedtls_gcm_context *ctx, int mode, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len)
Generic GCM stream start function.
int mbedtls_gcm_self_test(int verbose)
Checkup routine.
void mbedtls_gcm_free(mbedtls_gcm_context *ctx)
Free a GCM context and underlying cipher sub-context.
mbedtls_cipher_context_t cipher_ctx
int mbedtls_gcm_update(mbedtls_gcm_context *ctx, size_t length, const unsigned char *input, unsigned char *output)
Generic GCM update function.
int mbedtls_gcm_setkey(mbedtls_gcm_context *ctx, mbedtls_cipher_id_t cipher, const unsigned char *key, unsigned int keybits)
GCM initialization (encryption)
int mbedtls_gcm_finish(mbedtls_gcm_context *ctx, unsigned char *tag, size_t tag_len)
Generic GCM finalisation function.
int mbedtls_gcm_auth_decrypt(mbedtls_gcm_context *ctx, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *tag, size_t tag_len, const unsigned char *input, unsigned char *output)
GCM buffer authenticated decryption using a block cipher.
int mbedtls_gcm_crypt_and_tag(mbedtls_gcm_context *ctx, int mode, size_t length, const unsigned char *iv, size_t iv_len, const unsigned char *add, size_t add_len, const unsigned char *input, unsigned char *output, size_t tag_len, unsigned char *tag)
GCM buffer encryption/decryption using a block cipher.