Skip to content

Commit

Permalink
minicrypt: add AES implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Harvey committed Jan 4, 2014
1 parent 2d62d0d commit 7d677d1
Show file tree
Hide file tree
Showing 6 changed files with 545 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ Its key features are:
I am also including the Python models I've used when developing the code.


Testing
=======

All algorithm implementations can be turned into self-test programs by #defining
macro TEST_HARNESS. There is a Makefile in the host/ directory which does just
this. I'm testing these on Mac OS 10.8 with XCode 5 command-line tools, but it
should work as-is on pretty much any Linux too.

2 changes: 1 addition & 1 deletion host/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha2_mini_test
*_test
25 changes: 24 additions & 1 deletion host/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Setup -------------------------------

VPATH= .:../src
CC=gcc
CPPFLAGS= -I../src
Expand All @@ -6,17 +8,38 @@ CFLAGS= -Wall -Werror -Os $(CPPFLAGS)
default: all
TARGETS=

# Individual targets
# Individual targets ------------------

sha2_mini_test: sha2_mini.c sha2_mini.h
$(CC) $(CFLAGS) -DTEST_HARNESS -o $@ $<
TARGETS += sha2_mini_test

aes_mini_test: aes_mini.c aes_mini.h
$(CC) $(CFLAGS) -DTEST_HARNESS -o $@ $<
TARGETS += aes_mini_test

aes_mini_enc_test: aes_mini.c aes_mini.h
$(CC) $(CFLAGS) -DAESMINI_ENCRYPT_ONLY -DTEST_HARNESS -o $@ $<
TARGETS += aes_mini_enc_test

aes_mini_enc128_test: aes_mini.c aes_mini.h
$(CC) $(CFLAGS) -DAESMINI_ENCRYPT_ONLY -DAESMINI_128BIT_ONLY -DTEST_HARNESS -o $@ $<
TARGETS += aes_mini_enc128_test


# -------------------------------------

all: $(TARGETS)

clean:
rm -f $(TARGETS) *.o

# Running tests

.PHONY: test

test: $(TARGETS)
./sha2_mini_test
./aes_mini_test
./aes_mini_enc_test
./aes_mini_enc128_test
Loading

0 comments on commit 7d677d1

Please sign in to comment.