|
IBR-DTNSuite 0.6
|

Go to the source code of this file.
Defines | |
| #define | BSP_ENABLED true |
| #define | BLOCK_SIZE GCM_BLOCK_SIZE |
| #define | BLK_ADR_MASK (BLOCK_SIZE - 1) |
| #define | CTR_POS 12 |
| #define | inc_ctr(x) { int i = BLOCK_SIZE; while(i-- > CTR_POS && !++(ui8_ptr(x)[i])) ; } |
| #define | gf_mul_hh(a, ctx, scr) gf_mul_8k(a, ctx->gf_t8k, scr) |
Functions | |
| 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]) |
| ret_type | gcm_auth_header (const unsigned char hdr[], unsigned long hdr_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]) |
| ret_type | gcm_compute_tag (unsigned char tag[], unsigned long tag_len, gcm_ctx ctx[1]) |
| ret_type | gcm_end (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_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]) |
| #define BLK_ADR_MASK (BLOCK_SIZE - 1) |
Definition at line 52 of file gcm.cc.
Referenced by gcm_auth_data(), gcm_auth_header(), and gcm_crypt_data().
| #define BLOCK_SIZE GCM_BLOCK_SIZE |
Definition at line 51 of file gcm.cc.
Referenced by gcm_auth_data(), gcm_auth_header(), gcm_compute_tag(), gcm_crypt_data(), gcm_decrypt_message(), and gcm_init_message().
| #define CTR_POS 12 |
Definition at line 53 of file gcm.cc.
Referenced by gcm_compute_tag(), and gcm_init_message().
| #define gf_mul_hh | ( | a, | |
| ctx, | |||
| scr | |||
| ) | gf_mul_8k(a, ctx->gf_t8k, scr) |
Definition at line 86 of file gcm.cc.
Referenced by gcm_auth_data(), gcm_auth_header(), gcm_compute_tag(), and gcm_init_message().
| #define inc_ctr | ( | x | ) | { int i = BLOCK_SIZE; while(i-- > CTR_POS && !++(ui8_ptr(x)[i])) ; } |
Definition at line 55 of file gcm.cc.
Referenced by gcm_crypt_data(), and gcm_init_message().
Definition at line 197 of file gcm.cc.
References BLK_ADR_MASK, BLOCK_SIZE, BUF_ADRMASK, BUF_INC, GF_BYTE_LEN, gf_mul_hh, RETURN_OK, 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().

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, RETURN_OK, ui8_ptr, unit_ptr, xor_block(), and xor_block_aligned().
Referenced by gcm_decrypt_message(), and gcm_encrypt_message().

Definition at line 318 of file gcm.cc.
References gcm_ctx::aes, aes_encrypt, BLOCK_SIZE, CTR_POS, gcm_ctx::ctr_val, gcm_ctx::enc_ctr, GF_BYTE_LEN, gf_mul(), gf_mul_hh, gcm_ctx::ghash_h, gcm_ctx::hdr_cnt, gcm_ctx::hdr_ghv, RETURN_ERROR, RETURN_OK, RETURN_WARN, gcm_ctx::txt_acnt, gcm_ctx::txt_ccnt, gcm_ctx::txt_ghv, ui32_ptr, ui8_ptr, and gcm_ctx::y0_val.
Referenced by gcm_decrypt_message(), gcm_encrypt_message(), and ibrcommon::AES128Stream::getTag().

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, RETURN_OK, gcm_ctx::txt_ccnt, ui8_ptr, unit_ptr, xor_block(), and xor_block_aligned().
Referenced by gcm_decrypt(), and gcm_encrypt().

Definition at line 394 of file gcm.cc.
References gcm_auth_data(), gcm_crypt_data(), and RETURN_OK.
Referenced by ibrcommon::AES128Stream::decrypt(), and gcm_decrypt_message().

| 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(), gcm_init_message(), RETURN_ERROR, and RETURN_OK.

Definition at line 383 of file gcm.cc.
References gcm_auth_data(), gcm_crypt_data(), and RETURN_OK.
Referenced by ibrcommon::AES128Stream::encrypt(), and gcm_encrypt_message().

| 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(), gcm_init_message(), RETURN_ERROR, and RETURN_OK.

Definition at line 376 of file gcm.cc.
References RETURN_OK.
Referenced by ibrcommon::AES128Stream::~AES128Stream().
Definition at line 58 of file gcm.cc.
References gcm_ctx::aes, aes_encrypt, aes_encrypt_key(), gcm_ctx::gf_t8k, gcm_ctx::ghash_h, init_256_table(), init_4k_table(), init_64k_table(), init_8k_table(), RETURN_OK, and ui8_ptr.
Referenced by ibrcommon::AES128Stream::AES128Stream().

Definition at line 95 of file gcm.cc.
References BLOCK_SIZE, CTR_POS, gcm_ctx::ctr_val, GF_BYTE_LEN, gf_mul_hh, gcm_ctx::hdr_cnt, gcm_ctx::hdr_ghv, inc_ctr, RETURN_OK, gcm_ctx::txt_acnt, gcm_ctx::txt_ccnt, gcm_ctx::txt_ghv, ui32_ptr, ui8_ptr, xor_block_aligned(), and gcm_ctx::y0_val.
Referenced by ibrcommon::AES128Stream::AES128Stream(), gcm_decrypt_message(), and gcm_encrypt_message().
