Commits

Anonymous committed 4069c36

Upgrade to cryptlib-1.7. Added SHA-3 algorithm Keccek

  • Participants
  • Parent commits 154ea49

Comments (0)

Files changed (7)

   - Replaced occurrances of the deprecated operator 'or' with '||'
   - Revert cryptokit-1.5 to the OcamlForge archive and package our changes
     as a separate patch while to be install during 'make'.
+  - Upgraded to cryptlib-1.7, Added the SHA-3 algorithm, Keccek
 
 1.1.4
   - Fix X-HKP-Results-Count so that limit=0 returns no results, but include
 	touch prepared
 
 
-CKVER=cryptokit-1.5
+CKVER=cryptokit-1.7
 CKDIR=$(CKVER)/src
 
 $(CKVER)/README.txt:
 	tar xmvfz $(CKVER).tar.gz
-	patch -p 0 < cryptokit-1.5-sks.patch
+	patch -p 0 < $(CKVER)-sks.patch
 
 $(CKDIR)/cryptokit.cma: $(CKVER)/README.txt
 	cd $(CKDIR) && $(MAKE) all

File cryptokit-1.5-sks.patch

-diff -urN cryptokit-1.5.orig/README.sks cryptokit-1.5/README.sks
---- cryptokit-1.5.orig/README.sks	1969-12-31 18:00:00.000000000 -0600
-+++ cryptokit-1.5/README.sks	2013-06-18 23:32:41.492304411 -0500
-@@ -0,0 +1,12 @@
-+This is the cryptokit-1.5 source with a single change to allow building without
-+the OASIS build system, findlib, and their dependencies.
-+
-+The Makefile from cryptokit-1.3 was copied to cryptokit-1.5/src and patched to
-+build the blowfish code.
-+
-+Also fixed
-+    File "cryptokit.ml", line 1900, characters 19-21:
-+    Warning 3: deprecated feature: operator (or); you should use (||) instead
-+Which may cause issues with later Ocaml compilers
-+
-+The main SKS Makefile was changed to support the build.
-diff -urN cryptokit-1.5.orig/src/Makefile cryptokit-1.5/src/Makefile
---- cryptokit-1.5.orig/src/Makefile	1969-12-31 18:00:00.000000000 -0600
-+++ cryptokit-1.5/src/Makefile	2013-06-18 23:30:17.368293239 -0500
-@@ -0,0 +1,109 @@
-+### Configuration section
-+
-+# Comment next line if the Zlib library is not available
-+ZLIB=-DHAVE_ZLIB
-+
-+# The name of the Zlib library.  Usually -lz.  
-+# Leave blank if you don't have Zlib.
-+ZLIB_LIB=-lz
-+
-+# The directory containing the Zlib library (libz.a or libz.so)
-+# Leave blank if you don't have Zlib.
-+ZLIB_LIBDIR=/usr/lib
-+#ZLIB_LIBDIR=/usr/lib64    # for x86-64 Linux
-+
-+# The directory containing the Zlib header file (zlib.h)
-+ZLIB_INCLUDE=/usr/include
-+
-+# Where to install the library. By default: OCaml's standard library directory.
-+INSTALLDIR=`$(OCAMLC) -where`
-+
-+# Flags for the C compiler.
-+CFLAGS=-O -I$(ZLIB_INCLUDE) $(ZLIB)
-+
-+### End of configuration section
-+
-+OCAMLRUN=ocamlrun
-+OCAMLC=ocamlc -g
-+OCAMLOPT=ocamlopt
-+OCAMLDEP=ocamldep
-+MKLIB=ocamlmklib
-+OCAMLDOC=ocamldoc
-+
-+C_OBJS=\
-+  rijndael-alg-fst.o stubs-aes.o \
-+  d3des.o stubs-des.o \
-+  arcfour.o stubs-arcfour.o \
-+  sha1.o stubs-sha1.o \
-+  sha256.o stubs-sha256.o \
-+  ripemd160.o stubs-ripemd160.o \
-+  blowfish.o stubs-blowfish.o \
-+  stubs-md5.o \
-+  stubs-zlib.o \
-+  stubs-misc.o \
-+  stubs-rng.o
-+
-+CAML_OBJS=cryptokit.cmo
-+
-+all: libcryptokit.a cryptokit.cmi cryptokit.cma 
-+
-+allopt: libcryptokit.a cryptokit.cmi cryptokit.cmxa 
-+
-+libcryptokit.a: $(C_OBJS)
-+	$(MKLIB) -o cryptokit $(C_OBJS) -L$(ZLIB_LIBDIR) $(ZLIB_LIB)
-+
-+cryptokit.cma: $(CAML_OBJS)
-+	$(MKLIB) -o cryptokit $(CAML_OBJS) -L$(ZLIB_LIBDIR) $(ZLIB_LIB)
-+
-+cryptokit.cmxa: $(CAML_OBJS:.cmo=.cmx)
-+	$(MKLIB) -o cryptokit $(CAML_OBJS:.cmo=.cmx) -L$(ZLIB_LIBDIR) $(ZLIB_LIB)
-+
-+test: test.byt
-+	$(OCAMLRUN) -I . ./test.byt
-+
-+test.byt: libcryptokit.a cryptokit.cma test.ml
-+	$(OCAMLC) -o test.byt unix.cma nums.cma cryptokit.cma test.ml
-+
-+clean::
-+	rm -f test.byt
-+
-+speedtest: libcryptokit.a cryptokit.cmxa speedtest.ml
-+	$(OCAMLOPT) -o speedtest -ccopt -L. \
-+                unix.cmxa nums.cmxa cryptokit.cmxa speedtest.ml
-+
-+clean::
-+	rm -f speedtest
-+
-+install:
-+	cp cryptokit.cmi cryptokit.cma cryptokit.mli $(INSTALLDIR)
-+	cp libcryptokit.a $(INSTALLDIR)
-+	if test -f dllcryptokit.so; then cp dllcryptokit.so $(INSTALLDIR)/stublibs; fi
-+	if test -f cryptokit.cmxa; then cp cryptokit.cmxa cryptokit.cmx cryptokit.a $(INSTALLDIR); fi
-+
-+doc: FORCE
-+	cd doc; $(OCAMLDOC) -html -I .. ../cryptokit.mli
-+
-+FORCE:
-+
-+.SUFFIXES: .ml .mli .cmo .cmi .cmx
-+
-+.mli.cmi:
-+	$(OCAMLC) -c $(COMPFLAGS) $<
-+
-+.ml.cmo:
-+	$(OCAMLC) -c $(COMPFLAGS) $<
-+
-+.ml.cmx:
-+	$(OCAMLOPT) -c $(COMPFLAGS) $<
-+
-+.c.o:
-+	$(OCAMLC) -c -ccopt "$(CFLAGS)" $<
-+
-+clean::
-+	rm -f *.cm* *.o *.a *.so
-+
-+depend:
-+	gcc -MM -I `$(OCAMLC) -where` -isystem `$(OCAMLC) -where ` *.c > .depend
-+	$(OCAMLDEP) *.mli *.ml >> .depend
-+
-+include .depend
-diff -urN cryptokit-1.5.orig/src/cryptokit.ml cryptokit-1.5/src/cryptokit.ml
---- cryptokit-1.5.orig/src/cryptokit.ml	2011-06-23 03:26:31.000000000 -0500
-+++ cryptokit-1.5/src/cryptokit.ml	2013-06-18 23:33:08.676986486 -0500
-@@ -1897,7 +1897,7 @@
-           oend <- oend + 3
-       | _ -> ()
-       end;
--      if multiline or padding then begin
-+      if multiline || padding then begin
-         let num_equals =
-           match ipos with 1 -> 2 | 2 -> 1 | _ -> 0 in
-         self#ensure_capacity num_equals;

File cryptokit-1.5.tar.gz

Binary file removed.

File cryptokit-1.7-sks.patch

+diff -urN cryptokit-1.7-orig/README.sks cryptokit-1.7/README.sks
+--- cryptokit-1.7-orig/README.sks	1969-12-31 18:00:00.000000000 -0600
++++ cryptokit-1.7/README.sks	2013-06-19 00:30:29.097877008 -0500
+@@ -0,0 +1,15 @@
++5his is the cryptokit-1.7 source with small changes to allow building without
++the OASIS build system, findlib, and their dependencies.
++
++The Makefile from cryptokit-1.3 was copied to cryptokit-1.5/src and patched to
++build the blowfish code.
++
++For 1.7, the Makefile was edited to build keccak and stubs-sha3
++
++Also fixed
++    File "cryptokit.ml", line 1930[*], characters 19-21:
++    Warning 3: deprecated feature: operator (or); you should use (||) instead
++    [*] 1900 in cryptokit-1.5
++Which may cause issues with later Ocaml compilers
++
++The main SKS Makefile was changed to support the build.
+diff -urN cryptokit-1.7-orig/src/Makefile cryptokit-1.7/src/Makefile
+--- cryptokit-1.7-orig/src/Makefile	1969-12-31 18:00:00.000000000 -0600
++++ cryptokit-1.7/src/Makefile	2013-06-19 00:24:06.276997446 -0500
+@@ -0,0 +1,110 @@
++### Configuration section
++
++# Comment next line if the Zlib library is not available
++ZLIB=-DHAVE_ZLIB
++
++# The name of the Zlib library.  Usually -lz.  
++# Leave blank if you don't have Zlib.
++ZLIB_LIB=-lz
++
++# The directory containing the Zlib library (libz.a or libz.so)
++# Leave blank if you don't have Zlib.
++ZLIB_LIBDIR=/usr/lib
++#ZLIB_LIBDIR=/usr/lib64    # for x86-64 Linux
++
++# The directory containing the Zlib header file (zlib.h)
++ZLIB_INCLUDE=/usr/include
++
++# Where to install the library. By default: OCaml's standard library directory.
++INSTALLDIR=`$(OCAMLC) -where`
++
++# Flags for the C compiler.
++CFLAGS=-O -I$(ZLIB_INCLUDE) $(ZLIB)
++
++### End of configuration section
++
++OCAMLRUN=ocamlrun
++OCAMLC=ocamlc -g
++OCAMLOPT=ocamlopt
++OCAMLDEP=ocamldep
++MKLIB=ocamlmklib
++OCAMLDOC=ocamldoc
++
++C_OBJS=\
++  rijndael-alg-fst.o stubs-aes.o \
++  d3des.o stubs-des.o \
++  arcfour.o stubs-arcfour.o \
++  sha1.o stubs-sha1.o \
++  sha256.o stubs-sha256.o \
++  ripemd160.o stubs-ripemd160.o \
++  blowfish.o stubs-blowfish.o \
++  keccak.o stubs-sha3.o \
++  stubs-md5.o \
++  stubs-zlib.o \
++  stubs-misc.o \
++  stubs-rng.o
++
++CAML_OBJS=cryptokit.cmo
++
++all: libcryptokit.a cryptokit.cmi cryptokit.cma 
++
++allopt: libcryptokit.a cryptokit.cmi cryptokit.cmxa 
++
++libcryptokit.a: $(C_OBJS)
++	$(MKLIB) -o cryptokit $(C_OBJS) -L$(ZLIB_LIBDIR) $(ZLIB_LIB)
++
++cryptokit.cma: $(CAML_OBJS)
++	$(MKLIB) -o cryptokit $(CAML_OBJS) -L$(ZLIB_LIBDIR) $(ZLIB_LIB)
++
++cryptokit.cmxa: $(CAML_OBJS:.cmo=.cmx)
++	$(MKLIB) -o cryptokit $(CAML_OBJS:.cmo=.cmx) -L$(ZLIB_LIBDIR) $(ZLIB_LIB)
++
++test: test.byt
++	$(OCAMLRUN) -I . ./test.byt
++
++test.byt: libcryptokit.a cryptokit.cma test.ml
++	$(OCAMLC) -o test.byt unix.cma nums.cma cryptokit.cma test.ml
++
++clean::
++	rm -f test.byt
++
++speedtest: libcryptokit.a cryptokit.cmxa speedtest.ml
++	$(OCAMLOPT) -o speedtest -ccopt -L. \
++                unix.cmxa nums.cmxa cryptokit.cmxa speedtest.ml
++
++clean::
++	rm -f speedtest
++
++install:
++	cp cryptokit.cmi cryptokit.cma cryptokit.mli $(INSTALLDIR)
++	cp libcryptokit.a $(INSTALLDIR)
++	if test -f dllcryptokit.so; then cp dllcryptokit.so $(INSTALLDIR)/stublibs; fi
++	if test -f cryptokit.cmxa; then cp cryptokit.cmxa cryptokit.cmx cryptokit.a $(INSTALLDIR); fi
++
++doc: FORCE
++	cd doc; $(OCAMLDOC) -html -I .. ../cryptokit.mli
++
++FORCE:
++
++.SUFFIXES: .ml .mli .cmo .cmi .cmx
++
++.mli.cmi:
++	$(OCAMLC) -c $(COMPFLAGS) $<
++
++.ml.cmo:
++	$(OCAMLC) -c $(COMPFLAGS) $<
++
++.ml.cmx:
++	$(OCAMLOPT) -c $(COMPFLAGS) $<
++
++.c.o:
++	$(OCAMLC) -c -ccopt "$(CFLAGS)" $<
++
++clean::
++	rm -f *.cm* *.o *.a *.so
++
++depend:
++	gcc -MM -I `$(OCAMLC) -where` -isystem `$(OCAMLC) -where ` *.c > .depend
++	$(OCAMLDEP) *.mli *.ml >> .depend
++
++include .depend
+diff -urN cryptokit-1.7-orig/src/cryptokit.ml cryptokit-1.7/src/cryptokit.ml
+--- cryptokit-1.7-orig/src/cryptokit.ml	2013-04-23 12:41:40.000000000 -0500
++++ cryptokit-1.7/src/cryptokit.ml	2013-06-19 00:16:15.492252397 -0500
+@@ -1927,7 +1927,7 @@
+           oend <- oend + 3
+       | _ -> ()
+       end;
+-      if multiline or padding then begin
++      if multiline || padding then begin
+         let num_equals =
+           match ipos with 1 -> 2 | 2 -> 1 | _ -> 0 in
+         self#ensure_capacity num_equals;

File cryptokit-1.7.tar.gz

Binary file added.

File cryptokit-1.7.tar.gz.asc

+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.11 (GNU/Linux)
+
+iEYEABECAAYFAlF2ymgACgkQfqr+t65B+WDutgCghHwilaTaGBtlp1VzvEJiWpEz
+YjwAn2FvtwqkYzI3B1jMbNNYUvYqQUBr
+=uJCl
+-----END PGP SIGNATURE-----