OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
gcm128.c File Reference
#include <openssl/crypto.h>
#include "modes_lcl.h"
#include <string.h>
#include <assert.h>

Go to the source code of this file.

Macros

#define OPENSSL_FIPSAPI
 
#define NDEBUG
 
#define PACK(s)   ((size_t)(s)<<(sizeof(size_t)*8-16))
 
#define REDUCE1BIT(V)
 
#define GCM_MUL(ctx, Xi)   gcm_gmult_4bit(ctx->Xi.u,ctx->Htable)
 
#define GHASH(ctx, in, len)   gcm_ghash_4bit((ctx)->Xi.u,(ctx)->Htable,in,len)
 
#define GHASH_CHUNK   (3*1024)
 

Functions

void CRYPTO_gcm128_init (GCM128_CONTEXT *ctx, void *key, block128_f block)
 
void CRYPTO_gcm128_setiv (GCM128_CONTEXT *ctx, const unsigned char *iv, size_t len)
 
int CRYPTO_gcm128_aad (GCM128_CONTEXT *ctx, const unsigned char *aad, size_t len)
 
int CRYPTO_gcm128_encrypt (GCM128_CONTEXT *ctx, const unsigned char *in, unsigned char *out, size_t len)
 
int CRYPTO_gcm128_decrypt (GCM128_CONTEXT *ctx, const unsigned char *in, unsigned char *out, size_t len)
 
int CRYPTO_gcm128_encrypt_ctr32 (GCM128_CONTEXT *ctx, const unsigned char *in, unsigned char *out, size_t len, ctr128_f stream)
 
int CRYPTO_gcm128_decrypt_ctr32 (GCM128_CONTEXT *ctx, const unsigned char *in, unsigned char *out, size_t len, ctr128_f stream)
 
int CRYPTO_gcm128_finish (GCM128_CONTEXT *ctx, const unsigned char *tag, size_t len)
 
void CRYPTO_gcm128_tag (GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
 
GCM128_CONTEXTCRYPTO_gcm128_new (void *key, block128_f block)
 
void CRYPTO_gcm128_release (GCM128_CONTEXT *ctx)
 

Macro Definition Documentation

#define GCM_MUL (   ctx,
  Xi 
)    gcm_gmult_4bit(ctx->Xi.u,ctx->Htable)

Definition at line 574 of file gcm128.c.

#define GHASH (   ctx,
  in,
  len 
)    gcm_ghash_4bit((ctx)->Xi.u,(ctx)->Htable,in,len)

Definition at line 576 of file gcm128.c.

#define GHASH_CHUNK   (3*1024)

Definition at line 580 of file gcm128.c.

#define NDEBUG

Definition at line 58 of file gcm128.c.

#define OPENSSL_FIPSAPI

Definition at line 50 of file gcm128.c.

#define PACK (   s)    ((size_t)(s)<<(sizeof(size_t)*8-16))

Definition at line 71 of file gcm128.c.

#define REDUCE1BIT (   V)
Value:
do { \
if (sizeof(size_t)==8) { \
u64 T = U64(0xe100000000000000) & (0-(V.lo&1)); \
V.lo = (V.hi<<63)|(V.lo>>1); \
V.hi = (V.hi>>1 )^T; \
} \
else { \
u32 T = 0xe1000000U & (0-(u32)(V.lo&1)); \
V.lo = (V.hi<<63)|(V.lo>>1); \
V.hi = (V.hi>>1 )^((u64)T<<32); \
} \
} while(0)

Definition at line 72 of file gcm128.c.

Function Documentation

int CRYPTO_gcm128_aad ( GCM128_CONTEXT ctx,
const unsigned char *  aad,
size_t  len 
)

Definition at line 826 of file gcm128.c.

int CRYPTO_gcm128_decrypt ( GCM128_CONTEXT ctx,
const unsigned char *  in,
unsigned char *  out,
size_t  len 
)

Definition at line 1033 of file gcm128.c.

int CRYPTO_gcm128_decrypt_ctr32 ( GCM128_CONTEXT ctx,
const unsigned char *  in,
unsigned char *  out,
size_t  len,
ctr128_f  stream 
)

Definition at line 1285 of file gcm128.c.

int CRYPTO_gcm128_encrypt ( GCM128_CONTEXT ctx,
const unsigned char *  in,
unsigned char *  out,
size_t  len 
)

Definition at line 883 of file gcm128.c.

int CRYPTO_gcm128_encrypt_ctr32 ( GCM128_CONTEXT ctx,
const unsigned char *  in,
unsigned char *  out,
size_t  len,
ctr128_f  stream 
)

Definition at line 1186 of file gcm128.c.

int CRYPTO_gcm128_finish ( GCM128_CONTEXT ctx,
const unsigned char *  tag,
size_t  len 
)

Definition at line 1391 of file gcm128.c.

void CRYPTO_gcm128_init ( GCM128_CONTEXT ctx,
void key,
block128_f  block 
)

Definition at line 686 of file gcm128.c.

GCM128_CONTEXT* CRYPTO_gcm128_new ( void key,
block128_f  block 
)

Definition at line 1438 of file gcm128.c.

void CRYPTO_gcm128_release ( GCM128_CONTEXT ctx)

Definition at line 1448 of file gcm128.c.

void CRYPTO_gcm128_setiv ( GCM128_CONTEXT ctx,
const unsigned char *  iv,
size_t  len 
)

Definition at line 756 of file gcm128.c.

void CRYPTO_gcm128_tag ( GCM128_CONTEXT ctx,
unsigned char *  tag,
size_t  len 
)

Definition at line 1432 of file gcm128.c.