]> git.cryptolib.org Git - avr-crypto-lib.git/commitdiff
forgot the makefile and the round constant generator
authorbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Fri, 11 Apr 2008 17:56:11 +0000 (17:56 +0000)
committerbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Fri, 11 Apr 2008 17:56:11 +0000 (17:56 +0000)
noekeon.mk [new file with mode: 0644]
noekeon_genrc.c [new file with mode: 0644]

diff --git a/noekeon.mk b/noekeon.mk
new file mode 100644 (file)
index 0000000..3524623
--- /dev/null
@@ -0,0 +1,14 @@
+# Makefile for noekeon
+ALGO_NAME := NOEKEON
+
+# comment out the following line for removement of noekeon from the build process
+BLOCK_CIPHERS += $(ALGO_NAME)
+
+
+$(ALGO_NAME)_OBJ      := noekeon.o 
+$(ALGO_NAME)_TEST_BIN := main-noekeon-test.o debug.o uart.o serial-tools.o \
+                         noekeon.o nessie_bc_test.o \
+                         nessie_common.o cli.o performance_test.o
+$(ALGO_NAME)_NESSIE_TEST      := "nessie"
+$(ALGO_NAME)_PEROFRMANCE_TEST := "performance"
+
diff --git a/noekeon_genrc.c b/noekeon_genrc.c
new file mode 100644 (file)
index 0000000..cb8fac2
--- /dev/null
@@ -0,0 +1,35 @@
+/**
+ *
+ * author: Daniel Otte
+ * email:  daniel.otte@rub.de
+ * license: GPLv3
+ *
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+uint8_t getnextrc(uint8_t a){
+       if((a&0x80) != 0){
+               return (a<<1) ^ 0x1B;
+       } else {
+               return (a<<1);
+       }
+}
+
+#define N 32
+
+int main(void){
+       uint8_t c=0x80;
+       uint32_t i;
+       puts("\nNoekeon Round Constants:");
+       for(i=0; i<N; ++i){
+               printf(" 0x%2.2X,", c);
+               if(i%8==7){
+                       puts("");
+               }
+               c=getnextrc(c);
+       }
+       return 0;
+}
+