cryptlib  3.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
Classes | Macros | Typedefs | Functions
gcm.h File Reference
#include "crypt/aes.h"
#include "crypt/gf128mul.h"

Go to the source code of this file.

Classes

struct  gcm_ctx
 

Macros

#define UNIT_BITS   8
 
#define RETURN_WARN   1
 
#define RETURN_GOOD   0
 
#define RETURN_ERROR   -1
 
#define GCM_BLOCK_SIZE   AES_BLOCK_SIZE
 

Typedefs

typedef int ret_type
 

Functions

 UNIT_TYPEDEF (gcm_unit_t, UNIT_BITS)
 
 BUFR_TYPEDEF (gcm_buf_t, UNIT_BITS, AES_BLOCK_SIZE)
 
ret_type gcm_init_and_key (const unsigned char key[], unsigned long key_len, gcm_ctx ctx[1])
 
ret_type gcm_end (gcm_ctx ctx[1])
 
ret_type gcm_encrypt_message (const unsigned char iv[], unsigned long iv_len, const unsigned char hdr[], unsigned long hdr_len, unsigned char msg[], unsigned long msg_len, unsigned char tag[], unsigned long tag_len, gcm_ctx ctx[1])
 
ret_type gcm_decrypt_message (const unsigned char iv[], unsigned long iv_len, const unsigned char hdr[], unsigned long hdr_len, unsigned char msg[], unsigned long msg_len, const unsigned char tag[], unsigned long tag_len, gcm_ctx ctx[1])
 
ret_type gcm_init_message (const unsigned char iv[], unsigned long iv_len, gcm_ctx ctx[1])
 
ret_type gcm_auth_header (const unsigned char hdr[], unsigned long hdr_len, gcm_ctx ctx[1])
 
ret_type gcm_encrypt (unsigned char data[], unsigned long data_len, gcm_ctx ctx[1])
 
ret_type gcm_decrypt (unsigned char data[], unsigned long data_len, gcm_ctx ctx[1])
 
ret_type gcm_compute_tag (unsigned char tag[], unsigned long tag_len, gcm_ctx ctx[1])
 
ret_type gcm_auth_data (const unsigned char data[], unsigned long data_len, gcm_ctx ctx[1])
 
ret_type gcm_crypt_data (unsigned char data[], unsigned long data_len, gcm_ctx ctx[1])
 

Macro Definition Documentation

#define GCM_BLOCK_SIZE   AES_BLOCK_SIZE

Definition at line 85 of file gcm.h.

#define RETURN_ERROR   -1

Definition at line 78 of file gcm.h.

#define RETURN_GOOD   0

Definition at line 77 of file gcm.h.

#define RETURN_WARN   1

Definition at line 76 of file gcm.h.

#define UNIT_BITS   8

Definition at line 49 of file gcm.h.

Typedef Documentation

typedef int ret_type

Definition at line 81 of file gcm.h.

Function Documentation

BUFR_TYPEDEF ( gcm_buf_t  ,
UNIT_BITS  ,
AES_BLOCK_SIZE   
)
ret_type gcm_auth_data ( const unsigned char  data[],
unsigned long  data_len,
gcm_ctx  ctx[1] 
)

Definition at line 265 of file gcm.c.

ret_type gcm_auth_header ( const unsigned char  hdr[],
unsigned long  hdr_len,
gcm_ctx  ctx[1] 
)

Definition at line 208 of file gcm.c.

ret_type gcm_compute_tag ( unsigned char  tag[],
unsigned long  tag_len,
gcm_ctx  ctx[1] 
)

Definition at line 383 of file gcm.c.

ret_type gcm_crypt_data ( unsigned char  data[],
unsigned long  data_len,
gcm_ctx  ctx[1] 
)

Definition at line 322 of file gcm.c.

ret_type gcm_decrypt ( unsigned char  data[],
unsigned long  data_len,
gcm_ctx  ctx[1] 
)

Definition at line 503 of file gcm.c.

ret_type gcm_decrypt_message ( const unsigned char  iv[],
unsigned long  iv_len,
const unsigned char  hdr[],
unsigned long  hdr_len,
unsigned char  msg[],
unsigned long  msg_len,
const unsigned char  tag[],
unsigned long  tag_len,
gcm_ctx  ctx[1] 
)

Definition at line 530 of file gcm.c.

ret_type gcm_encrypt ( unsigned char  data[],
unsigned long  data_len,
gcm_ctx  ctx[1] 
)

Definition at line 492 of file gcm.c.

ret_type gcm_encrypt_message ( const unsigned char  iv[],
unsigned long  iv_len,
const unsigned char  hdr[],
unsigned long  hdr_len,
unsigned char  msg[],
unsigned long  msg_len,
unsigned char  tag[],
unsigned long  tag_len,
gcm_ctx  ctx[1] 
)

Definition at line 513 of file gcm.c.

ret_type gcm_end ( gcm_ctx  ctx[1])

Definition at line 485 of file gcm.c.

ret_type gcm_init_and_key ( const unsigned char  key[],
unsigned long  key_len,
gcm_ctx  ctx[1] 
)

Definition at line 102 of file gcm.c.

ret_type gcm_init_message ( const unsigned char  iv[],
unsigned long  iv_len,
gcm_ctx  ctx[1] 
)

Definition at line 165 of file gcm.c.

UNIT_TYPEDEF ( gcm_unit_t  ,
UNIT_BITS   
)