IBR-DTNSuite  0.8
ibrcommon/ibrcommon/ssl/gcm/gcm.h File Reference
#include "gcm_aes.h"
#include "gf128mul.h"
Include dependency graph for gcm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gcm_ctx

Defines

#define GCM_BLOCK_SIZE   AES_BLOCK_SIZE

Typedefs

typedef int ret_type

Functions

 dec_unit_type (BFR_UNIT, buf_unit)
 dec_bufr_type (BFR_UNIT, AES_BLOCK_SIZE, buf_type)
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])

Define Documentation

#define GCM_BLOCK_SIZE   AES_BLOCK_SIZE

Definition at line 81 of file gcm.h.


Typedef Documentation

typedef int ret_type

Definition at line 77 of file gcm.h.


Function Documentation

dec_bufr_type ( BFR_UNIT  ,
AES_BLOCK_SIZE  ,
buf_type   
)
dec_unit_type ( BFR_UNIT  ,
buf_unit   
)
ret_type gcm_auth_data ( const unsigned char  data[],
unsigned long  data_len,
gcm_ctx  ctx[1] 
)

Definition at line 197 of file gcm.cc.

References BLK_ADR_MASK, BLOCK_SIZE, BUF_ADRMASK, BUF_INC, GF_BYTE_LEN, gf_mul_hh, gcm_ctx::txt_acnt, gcm_ctx::txt_ghv, ui8_ptr, unit_ptr, xor_block(), and xor_block_aligned().

Referenced by gcm_decrypt(), and gcm_encrypt().

Here is the call graph for this function:

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

Definition at line 139 of file gcm.cc.

References BLK_ADR_MASK, BLOCK_SIZE, BUF_ADRMASK, BUF_INC, GF_BYTE_LEN, gf_mul_hh, gcm_ctx::hdr_cnt, gcm_ctx::hdr_ghv, ui8_ptr, unit_ptr, xor_block(), and xor_block_aligned().

Referenced by gcm_decrypt_message(), and gcm_encrypt_message().

Here is the call graph for this function:

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

Definition at line 255 of file gcm.cc.

References gcm_ctx::aes, aes_encrypt, BLK_ADR_MASK, BLOCK_SIZE, BUF_ADRMASK, BUF_INC, gcm_ctx::ctr_val, gcm_ctx::enc_ctr, inc_ctr, gcm_ctx::txt_ccnt, ui8_ptr, unit_ptr, xor_block(), and xor_block_aligned().

Referenced by gcm_decrypt(), and gcm_encrypt().

Here is the call graph for this function:

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

Definition at line 394 of file gcm.cc.

References gcm_auth_data(), and gcm_crypt_data().

Referenced by ibrcommon::AES128Stream::decrypt(), and gcm_decrypt_message().

Here is the call graph for this function:

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 421 of file gcm.cc.

References BLOCK_SIZE, gcm_auth_header(), gcm_compute_tag(), gcm_decrypt(), and gcm_init_message().

Here is the call graph for this function:

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

Definition at line 383 of file gcm.cc.

References gcm_auth_data(), and gcm_crypt_data().

Referenced by ibrcommon::AES128Stream::encrypt(), and gcm_encrypt_message().

Here is the call graph for this function:

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 404 of file gcm.cc.

References gcm_auth_header(), gcm_compute_tag(), gcm_encrypt(), and gcm_init_message().

Here is the call graph for this function:

ret_type gcm_end ( gcm_ctx  ctx[1])

Definition at line 376 of file gcm.cc.

Referenced by ibrcommon::AES128Stream::~AES128Stream().

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