aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/idea
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/idea')
-rw-r--r--crypto/idea/Makefile.uni73
-rw-r--r--crypto/idea/idea.h8
2 files changed, 77 insertions, 4 deletions
diff --git a/crypto/idea/Makefile.uni b/crypto/idea/Makefile.uni
new file mode 100644
index 00000000000..c83339ad6d4
--- /dev/null
+++ b/crypto/idea/Makefile.uni
@@ -0,0 +1,73 @@
+# Targets
+# make - twidle the options yourself :-)
+# make cc - standard cc options
+# make gcc - standard gcc options
+
+DIR= cast
+TOP= .
+CC= gcc
+CFLAG= -O3 -fomit-frame-pointer
+
+CPP= $(CC) -E
+INCLUDES=
+INSTALLTOP=/usr/local/lib
+MAKE= make
+MAKEDEPEND= makedepend
+MAKEFILE= Makefile.uni
+AR= ar r
+RANLIB= ranlib
+
+IDEA_ENC=i_cbc.o
+
+CFLAGS= $(INCLUDES) $(CFLAG)
+
+GENERAL=Makefile
+TEST=ideatest
+APPS=idea_spd
+
+LIB=libidea.a
+LIBSRC=i_skey.c i_ecb.c i_cbc.c i_cfb64.c i_ofb64.c
+LIBOBJ=i_skey.o i_ecb.o $(IDEA_ENC) i_cfb64.o i_ofb64.o
+
+SRC= $(LIBSRC)
+
+EXHEADER= idea.h
+HEADER= idea_lcl.h $(EXHEADER)
+
+ALL= $(GENERAL) $(SRC) $(HEADER)
+
+all: $(LIB) $(TEST) $(APPS)
+
+$(LIB): $(LIBOBJ)
+ $(AR) $(LIB) $(LIBOBJ)
+ $(RANLIB) $(LIB)
+
+test: $(TEST)
+ ./$(TEST)
+
+$(TEST): $(TEST).c $(LIB)
+ $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB)
+
+$(APPS): $(APPS).c $(LIB)
+ $(CC) -o $(APPS) $(CFLAGS) $(APPS).c $(LIB)
+
+lint:
+ lint -DLINT $(INCLUDES) $(SRC)>fluff
+
+depend:
+ $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
+
+dclean:
+ perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
+ mv -f Makefile.new $(MAKEFILE)
+
+clean:
+ /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+
+cc:
+ $(MAKE) CC="cc" CFLAG="-O" all
+
+gcc:
+ $(MAKE) CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/idea/idea.h b/crypto/idea/idea.h
index f5efeae366d..ae32f5692e5 100644
--- a/crypto/idea/idea.h
+++ b/crypto/idea/idea.h
@@ -59,6 +59,10 @@
#ifndef HEADER_IDEA_H
#define HEADER_IDEA_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef NO_IDEA
#error IDEA is disabled.
#endif
@@ -70,10 +74,6 @@
#define IDEA_BLOCK 8
#define IDEA_KEY_LENGTH 16
-#ifdef __cplusplus
-extern "C" {
-#endif
-
typedef struct idea_key_st
{
IDEA_INT data[9][6];