]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Test program för blowfish.
authorNiels Möller <nisse@lysator.liu.se>
Wed, 16 Dec 1998 01:09:13 +0000 (02:09 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 16 Dec 1998 01:09:13 +0000 (02:09 +0100)
Rev: src/symmetric/Makefile.am.in:1.5
Rev: src/symmetric/bf_test.c:1.1

Makefile.am.in
bf_test.c [new file with mode: 0644]

index 7931f0b24b14e675a3e202e4024c99746a691b6e..1351751d17048610df61e6dc0dfaf8a04fd3f537 100644 (file)
@@ -5,12 +5,13 @@ BODY:
 AUTOMAKE_OPTIONS = foreign
 
 noinst_LIBRARIES = libsymmetric.a
-noinst_PROGRAMS = desTest desdata
+noinst_PROGRAMS = desTest desdata bf_test
 
 # When compiling with lsh, this is set to to -DLSH -I/path/to/lsh/include
 # INCLUDES = @crypto_cpp_flags@
 
-desTest_LDADD = libsymmetric.a
+LDADD = libsymmetric.a
+desdata_LDADD =
 
 des_headers = parity.h rotors.h keymap.h 
 BUILT_SOURCES =        desSmallFips.c desSmallCore.c desQuickFips.c desQuickCore.c \
@@ -18,7 +19,7 @@ BUILT_SOURCES =       desSmallFips.c desSmallCore.c desQuickFips.c desQuickCore.c \
 
 libsymmetric_a_SOURCES = desCode.h desKerb.c desUtil.c desQuick.c \
       $(BUILT_SOURCES) \
-      sha.c md5.c idea.c rc4.c cast.c blowfish.c util.c
+      sha.c md5.c idea.c rc4.c cast.c blowfish.c
 
 # Generate DES headers.
 $(des_headers): desdata
diff --git a/bf_test.c b/bf_test.c
new file mode 100644 (file)
index 0000000..74ce624
--- /dev/null
+++ b/bf_test.c
@@ -0,0 +1,24 @@
+/* bf_test.c
+ *
+ * $Id$
+ * Test the blow fish implementation. */
+
+#include "blowfish.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main (int argc, char **argv)
+{
+  if (bf_selftest())
+    {
+      fprintf(stderr, "Blowfish works.\n");
+      exit(EXIT_SUCCESS);
+    }
+  else
+    {
+      fprintf(stderr, "ERROR: Blowfish failed.\n");
+      exit(EXIT_FAILURE);
+    }
+}
+