Building the Software

Home page

 

Gecko Architecture

 

Modes: CBC, CTR, ECB, PCBC, CFB, OFB

 

Test Harnesses and Sample programs

 

Downloads

 

Building the Software

About Gecko

 

 

If you are building for Windows and have Visual Studio, there isn’t much you need to do. The included projects contain all the #defines and complier flags already.

However, this is such a quick read, it may be worth while to go through the quick introduction to become familiar with some of the compile-time properties of the distribution.

 

#defines and compiler defines:

You must define at least one of these for your implementation to enable the corresponding mode.

The Gecko test harness enables all modes (so all are defined,) since all modes are tested.

GKO_ENABLE_CBC

Cipher Block Chaining (CBC)

GKO_ENABLE_CFB

Cipher Feedback (CFB)

GKO_ENABLE_CTR

Counter (CTR)

GKO_ENABLE_ECB

Electronic Codebook (ECB)

GKO_ENABLE_OFB

Output Feedback (OFB)

GKO_ENABLE_PCBC

Propagating Cipher Block Chaining (PCBC)

 

You will also need to define at most one of:

_GKO256

256 bit key

_GKO192

192 bit key

_GKO128

128 bit key

 

#define GKO_SPEED_OVER_SIZE:

Gecko defines GKO_SPEED_OVER_SIZE as follows:

#ifndef _SIZE

#define GKO_SPEED_OVER_SIZE

#endif

 

Defining SPEED_OVER_SIZE unrolls all the 16 byte loops that process input bytes resulting in ~100% speedups.

This unrolling of loops adds a little bit to the overall size, but the speed benefits are striking (at least on my compiler.)

You are certainly welcome to define this or not, independent of build: Release, Size, Debug, depending on your needs.

 

Compiler Intrinsics _rotl8()

Gecko uses the compiler intrinsic _rotl8() to rotate the bits in an 8 bit byte left. You must enable Compiler Intrinsics in your C compiler for _rotl8().
If your compiler does not have an intrinsic for _rotl8(), then you can use the C source code version I provide in the GKO_platform.c file.

 

 

 

Building the Individual Projects (non-Windows)

 

This distribution contains two solutions. A solution is simply a collection of related projects, and a project is really just a MAKEFILE within its own directory.

Lets look at once example: C:\Tomasello Software\Gecko Encryption\Gecko_Encryption\Gecko_test_128

Gecko_test_128 is the project that exercises Gecko (and AES,) in 128 bit mode.

To build Gecko_test_128, you would simply compile all the C source files in that directory, and include the headers from:
C:\Tomasello Software\Gecko Encryption\Gecko_Encryption\Includes

For example “stdint.h” is locates here.

And include gecko.c, aes.c, GKO_platform.c, Mersenne Twister.c, and test_helpers.c from:

C:\Tomasello Software\Gecko Encryption\Gecko_Encryption\Source

 

The tree structure looks like this:

 

So to build the project Gecko_test_128, you would pull in the dependencies from both Source and Includes.

All projects work exactly like this, and many even have fewer dependencies (no aes.c, Mersenne Twister.c, test_helpers.c, etc.)

 

That’s it.

If you have any problems building the code, or if I have omitted any steps, please let me know on my facebook page:

Discuss on Facebook: https://www.facebook.com/Tomasello.Software

Email: luke@tomasello.com