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