Annotation of truecrypt/common/gfmul.h, revision 1.1.1.4

1.1       root        1: /*
                      2:  ---------------------------------------------------------------------------
                      3:  Copyright (c) 2003, Dr Brian Gladman, Worcester, UK.   All rights reserved.
                      4: 
                      5:  LICENSE TERMS
                      6: 
1.1.1.3   root        7:  The free distribution and use of this software is allowed (with or without
                      8:  changes) provided that:
1.1       root        9: 
1.1.1.3   root       10:   1. source code distributions include the above copyright notice, this
                     11:      list of conditions and the following disclaimer;
1.1       root       12: 
1.1.1.3   root       13:   2. binary distributions include the above copyright notice, this list
                     14:      of conditions and the following disclaimer in their documentation;
                     15: 
                     16:   3. the name of the copyright holder is not used to endorse products
                     17:      built using this software without specific written permission.
1.1       root       18: 
                     19:  DISCLAIMER
                     20: 
                     21:  This software is provided 'as is' with no explicit or implied warranties
                     22:  in respect of its properties, including, but not limited to, correctness
                     23:  and/or fitness for purpose.
                     24:  ---------------------------------------------------------------------------
                     25:  Issue Date: 31/01/2004
                     26: */
                     27: 
1.1.1.4 ! root       28: /* Adapted for TrueCrypt */
1.1       root       29: 
                     30: #ifndef _GCM_H
                     31: #define _GCM_H
                     32: 
                     33: #include "Tcdefs.h"
                     34: 
                     35: #if defined(__cplusplus)
                     36: extern "C"
                     37: {
                     38: #endif
                     39: 
                     40: #define CBLK_LEN   16  /* encryption block length */
                     41: #define CBLK_LEN8  8
                     42: 
                     43: typedef struct
                     44: {
                     45:     unsigned __int32 gf_t8k[CBLK_LEN * 2][16][CBLK_LEN / 4];
                     46: } GfCtx8k;
                     47: 
                     48: typedef struct
                     49: {
                     50:                unsigned __int32 gf_t4k[CBLK_LEN8 * 2][16][CBLK_LEN / 4];
                     51: } GfCtx4k64;
                     52: 
                     53: typedef struct
                     54: {
                     55:        /* union not used to support faster mounting */
                     56:     unsigned __int32 gf_t128[CBLK_LEN * 2 / 2][16][CBLK_LEN / 4];
                     57:     unsigned __int32 gf_t64[CBLK_LEN8 * 2][16][CBLK_LEN8 / 4];
                     58: } GfCtx;
                     59: 
                     60: typedef int  ret_type;
                     61: 
                     62: void GfMul128 (void *a, const void* b);
                     63: void GfMul128Tab(unsigned char a[16], GfCtx8k *ctx);
                     64: int Gf128Tab64Init (unsigned __int8 *a, GfCtx *ctx);
                     65: void Gf128MulBy64Tab (unsigned __int8 a[8], unsigned __int8 p[16], GfCtx *ctx);
                     66: int Gf64TabInit (unsigned __int8 *a, GfCtx *ctx);
                     67: void Gf64MulTab (unsigned char a[8], unsigned char p[8], GfCtx *ctx);
1.1.1.2   root       68: void MirrorBits128 (unsigned __int8 *a);
                     69: void MirrorBits64 (unsigned __int8 *a);
1.1       root       70: BOOL GfMulSelfTest ();
                     71: 
                     72: #if defined(__cplusplus)
                     73: }
                     74: #endif
                     75: 
                     76: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.