Zork GCM setup
The Zork GCM implementation is a single .c file meant for you to
compile directly into your projects. However, there are a few minor
prerequisites:
- You must have an existing AES implementation. If you have a
version of OpenSSL with AES (0.9.7 and later) then you only need to
link against it (-lcrypto). Otherwise, see the section AES
Setup below.
If your architecture does not have BYTE_ORDER defined (some
embedded platforms may not), then you need to set it, along with
values of BIG_ENDIAN and LITTLE_ENDIAN.
- If sizeof(unsigned int) != 4 or sizeof(unsigned
long long) != 8, then you will need to change the typedefs
for uint64 and uint32 in gcm.h to
appropriate values. Note that most compilers provide an
emulated 64-bit type. Using this type helps speed things up on
64-bit platforms. If your platform doesn't have a 64-bit type
(emulated or no), we provide an alternate interoperating
implementation in gcm32.h and gcm32.c.
AES Setup
If you're using an AES implementation other than the one provided with
OpenSSL, then you will need to redefine three macros in gcm.h:
- KEY_SCHED, which is the general key data type used
by the block cipher after key setup (it's generally an expanded
version of the key);
- ENCRYPT_INIT(KEY_SCHED *, unsigned char key[16], int keysize_bits); and
- DO_ENCRYPT(KEY_SCHED *, unsigned char input[16], unsigned char output[16])
Back