Commits

Palmer, 2E0EOL committed ce691c0

Entire changeset: daybocrypt-1.0.0 -> daybocrypt-1.0.2

Comments (0)

Files changed (54)

+$Id: ChangeLog,v 1.0.2, 2004/06/18 18:23:00 ddrp Rel $
+
+Copyright (C) 2002-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+NOTE: There are also license restrictions on various algorithms which will
+need to be taken into account.  Read license notes in individual files'
+source if you will be using functions within those files.
+
+This ChangeLog was created on 7th March 2004.
+
+17th June 2004 - 1.0.2
+----------------------
+DDRP: Corrected date of previous release
+DDRP: Added make install/uninstall for UNIX-like systems
+DDRP: Re-created Borland files, deleted garbage files
+DDRP: Slight correction to to correct signedness error on gcc 2.95.4
+      in test/dcthash.c
+DDRP: Correction of symbols in header using implementation-reserved
+      namespace
+DDRP: Deleted redundant dctkmod.h header
+DDRP: Made new test.h
+DDRP: Enabled many warnings and fixed all casualties
+DDRP: Make testbed PrintVersion() a static function
+DDRP: Removed non-prototyped functions which confused Turbo C
+
+7th March 2004 - 1.0.1
+----------------------
+DDRP: Amendment to DAYBOCRYPT_API when not built as a .DLL
+
+6th March 2004 - 1.0.0
+----------------------
+Initial release

Docs/build/output/borland.txt

+Microsoft Windows 2000 [Version 5.00.2195]
+(C) Copyright 1985-2000 Microsoft Corp.
+
+W:\shared\dybocryp>build
+$Id: build.bat,v 0.4 2004/03/21 17:00:00 ddrp Rel $
+Welcome to DayboCrypt!
+Please make sure you understand all the license
+implications for all the algorithms you wish to use from
+this library.
+
+We will now begin building this library.  This will
+fail if you do not have Perl installed and on the path.
+You will need to answer a few questions, I have kept this
+to a minimum because I realise you are busy.
+If the script hangs on loading Perl, you have not set up
+the perllib_prefix environment variable (this applies to
+the DOS version of Perl only).
+
+Loading Perl...
+Please select one of the following supported compilers
+if you do not see your compiler listed, press 0 and build
+the library yourself.
+0) You don't support my compiler
+1) Borland Turbo C for DOS
+2) Borland C
+3) Watcom C
+4) GNU C
+
+Press a number, followed by [ENTER] >2
+MAKE Version 5.2  Copyright (c) 1987, 1999 Inprise Corp.
+	bcc32 -c -I. -A  dybocryp.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dybocryp.c:
+	bcc32 -c -I. -A  dctkmod.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dctkmod.c:
+	bcc32 -c -I. -A  dccaesar.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dccaesar.c:
+	bcc32 -c -I. -A  dcmd2.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcmd2.c:
+	bcc32 -c -I. -A  dcmd4.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcmd4.c:
+	bcc32 -c -I. -A  dcmd5.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcmd5.c:
+	bcc32 -c -I. -A  dcsha1.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcsha1.c:
+	bcc32 -c -I. -A  dchshcmp.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dchshcmp.c:
+	bcc32 -c -I. -A  dchshlen.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dchshlen.c:
+	perl -w ../scripts/libtool.pl bor dybocryp.lib *.obj
+Daybo Logic OC libtool 0.6 (20040121), (C)2003-2004 David Duncan Ross Palmer
+
+if exist dybocryp.lib erase dybocryp.lib
+tlib dybocryp.lib +dccaesar.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dchshcmp.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dchshlen.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dcmd2.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dcmd4.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dcmd5.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dcsha1.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dctkmod.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+tlib dybocryp.lib +dybocryp.obj
+TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
+	cd test
+	perl -w ../../scripts/maker.pl bor -DDEBUG= -DCC=bcc32 -f Makefile.bor
+Daybo Logic DayboCrypt Maker - Version 0.4 (20040617)
+MAKE Version 5.2  Copyright (c) 1987, 1999 Inprise Corp.
+	bcc32 -I.. -A  -c test.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+test.c:
+	bcc32 -I.. -A  -c dcttkmod.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcttkmod.c:
+	bcc32 -I.. -A  -c dctcaesa.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dctcaesa.c:
+	bcc32 -I.. -DALG_MD2 -A  -odctmd2.obj -c dcthash.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcthash.c:
+	bcc32 -I.. -DALG_MD4 -A  -odctmd4.obj -c dcthash.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcthash.c:
+	bcc32 -I.. -DALG_MD5 -A  -odctmd5.obj -c dcthash.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcthash.c:
+	bcc32 -I.. -DALG_SHA1 -A  -odctsha1.obj -c dcthash.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcthash.c:
+	bcc32 -I.. -A  -c dcthshln.c
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+dcthshln.c:
+	bcc32  -etest.exe *.obj ../dybocryp.lib
+Borland C++ 5.4 for Win32 Copyright (c) 1993, 1999 Inprise Corporation
+Turbo Incremental Link 4.00 Copyright (c) 1997, 1999 Inprise Corporation
+	cd ..
+	cd test
+	perl -w ../../scripts/maker.pl bor -DDEBUG= -DCC=bcc32 -f Makefile.bor run
+Daybo Logic DayboCrypt Maker - Version 0.4 (20040617)
+MAKE Version 5.2  Copyright (c) 1987, 1999 Inprise Corp.
+	./test.exe
+DayboCrypt - intensive test suite.  (C)2002-2004 Daybo Logic, all rights
+reserved.    http://www.daybologic.co.uk/    Released under BSD license.
+Using DayboCrypt V1.0.2
+
+Total Konfuzion's modulator
+	(C) 2002 digiServ Web Solutions,
+	used with permission.
+RSA Data Security, Inc. MD2 Message-Digest Algorithm (for non-commercial use)
+RSA Data Security, Inc. MD4 Message-Digest Algorithm
+RSA Data Security, Inc. MD5 Message-Digest Algorithm
+US Secure Hash Algorithm 1 (SHA1)
+	Copyright (C) The Internet Society (2001).
+	All Rights Reserved.
+
+
+Testing Hash length support functions(s)...OK
+Testing Total Konfuzion modulator...OK
+Testing DDRP - Caesar's Cipher...OK
+Testing RSA MD2 message Digest Algorithm...OK
+Testing RSA MD4 message Digest Algorithm...OK
+Testing RSA MD5 Message Digest Algorithm...OK
+Testing NSA SHA-1 Secure Hash Algorithm...OK
+
+No failures detected.
+
+	cd ..
+
+W:\shared\dybocryp>

Docs/build/output/freebsd.txt

+Script started on Fri Jun 18 16:46:03 2004
+bash-2.05b$ ./build.sh
+Please select one of the following supported compilers
+if you do not see your compiler listed, press 0 and build
+the library yourself.
+0) You don't support my compiler
+1) Borland Turbo C for DOS
+2) Borland C
+3) Watcom C
+4) GNU C
+
+Press a number, followed by [ENTER] >4
+compiling dctkmod.c
+In file included from /usr/include/string.h:50,
+                 from dctkmod.c:46:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+compiling dccaesar.c
+In file included from /usr/include/string.h:50,
+                 from dccaesar.c:47:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+compiling dcmd2.c
+In file included from /usr/include/string.h:50,
+                 from dcmd2.c:35:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+compiling dcmd4.c
+In file included from /usr/include/string.h:50,
+                 from dcmd4.c:38:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+compiling dcmd5.c
+In file included from /usr/include/string.h:50,
+                 from dcmd5.c:32:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+compiling dcsha1.c
+compiling dchshcmp.c
+compiling dchshlen.c
+compiling dybocryp.c
+perl -w ../scripts/libtool.pl gnu libdybocryp.a dctkmod.o dccaesar.o dcmd2.o dcmd4.o dcmd5.o dcsha1.o dchshcmp.o dchshlen.o dybocryp.o
+Daybo Logic OC libtool 0.7 (20040618), (C)2003-2004 David Duncan Ross Palmer
+
+ar cru libdybocryp.a dctkmod.o
+ar cru libdybocryp.a dccaesar.o
+ar cru libdybocryp.a dcmd2.o
+ar cru libdybocryp.a dcmd4.o
+ar cru libdybocryp.a dcmd5.o
+ar cru libdybocryp.a dcsha1.o
+ar cru libdybocryp.a dchshcmp.o
+ar cru libdybocryp.a dchshlen.o
+ar cru libdybocryp.a dybocryp.o
+ranlib libdybocryp.a
+cd test && perl -w ../../scripts/maker.pl gnu -f GNUmakefile
+Daybo Logic DayboCrypt Maker - Version 0.4 (20040617)
+gmake[1]: Entering directory `/usr/home/overlord/work/shared/dybocryp/test'
+Compiling test.c
+In file included from /usr/include/stdio.h:43,
+                 from test.c:43:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Compiling dcttkmod.c
+In file included from /usr/include/string.h:50,
+                 from dcttkmod.c:10:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Compiling dctcaesa.c
+In file included from /usr/include/string.h:50,
+                 from dctcaesa.c:38:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Compiling dcthash.c
+In file included from /usr/include/string.h:50,
+                 from dcthash.c:47:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Compiling dcthash.c
+In file included from /usr/include/string.h:50,
+                 from dcthash.c:47:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Compiling dcthash.c
+In file included from /usr/include/string.h:50,
+                 from dcthash.c:47:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Compiling dcthash.c
+In file included from /usr/include/string.h:50,
+                 from dcthash.c:47:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Compiling dcthshln.c
+In file included from /usr/include/string.h:50,
+                 from dcthshln.c:39:
+/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
+/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
+Linking test
+gmake[1]: Leaving directory `/usr/home/overlord/work/shared/dybocryp/test'
+cd test && perl -w ../../scripts/maker.pl gnu -f GNUmakefile run
+Daybo Logic DayboCrypt Maker - Version 0.4 (20040617)
+gmake[1]: Entering directory `/usr/home/overlord/work/shared/dybocryp/test'
+./test
+DayboCrypt - intensive test suite.  (C)2002-2004 Daybo Logic, all rights
+reserved.    http://www.daybologic.co.uk/    Released under BSD license.
+Using DayboCrypt V1.0.2
+
+Total Konfuzion's modulator
+	(C) 2002 digiServ Web Solutions,
+	used with permission.
+RSA Data Security, Inc. MD2 Message-Digest Algorithm (for non-commercial use)
+RSA Data Security, Inc. MD4 Message-Digest Algorithm
+RSA Data Security, Inc. MD5 Message-Digest Algorithm
+US Secure Hash Algorithm 1 (SHA1)
+	Copyright (C) The Internet Society (2001).
+	All Rights Reserved.
+
+
+Testing Hash length support functions(s)...OK
+Testing Total Konfuzion modulator...OK
+Testing DDRP - Caesar's Cipher...OK
+Testing RSA MD2 message Digest Algorithm...OK
+Testing RSA MD4 message Digest Algorithm...OK
+Testing RSA MD5 Message Digest Algorithm...OK
+Testing NSA SHA-1 Secure Hash Algorithm...OK
+
+No failures detected.
+
+gmake[1]: Leaving directory `/usr/home/overlord/work/shared/dybocryp/test'
+bash-2.05b$ exit
+exit
+
+Script done on Fri Jun 18 16:46:31 2004

Docs/build/output/gnu.txt

+Script started on Fri Jun 18 14:31:41 2004
+overlord@torvalds:~/work/shared/dybocryp$ ./build.sh
+Please select one of the following supported compilers
+if you do not see your compiler listed, press 0 and build
+the library yourself.
+0) You don't support my compiler
+1) Borland Turbo C for DOS
+2) Borland C
+3) Watcom C
+4) GNU C
+
+Press a number, followed by [ENTER] >4
+Can't exec "gmake": No such file or directory at build.pl line 70, <STDIN> line 1.
+compiling dctkmod.c
+compiling dccaesar.c
+compiling dcmd2.c
+compiling dcmd4.c
+compiling dcmd5.c
+compiling dcsha1.c
+compiling dchshcmp.c
+compiling dchshlen.c
+compiling dybocryp.c
+perl -w ../scripts/libtool.pl gnu libdybocryp.a dctkmod.o dccaesar.o dcmd2.o dcmd4.o dcmd5.o dcsha1.o dchshcmp.o dchshlen.o dybocryp.o
+Daybo Logic OC libtool 0.6 (20040121), (C)2003-2004 David Duncan Ross Palmer
+
+ar cru libdybocryp.a dctkmod.o
+ar cru libdybocryp.a dccaesar.o
+ar cru libdybocryp.a dcmd2.o
+ar cru libdybocryp.a dcmd4.o
+ar cru libdybocryp.a dcmd5.o
+ar cru libdybocryp.a dcsha1.o
+ar cru libdybocryp.a dchshcmp.o
+ar cru libdybocryp.a dchshlen.o
+ar cru libdybocryp.a dybocryp.o
+ranlib libdybocryp.a
+cd test && perl -w ../../scripts/maker.pl gnu -f GNUmakefile
+Daybo Logic DayboCrypt Maker - Version 0.4 (20040617)
+Can't exec "gmake": No such file or directory at ../../scripts/maker.pl line 85.
+make[1]: Entering directory `/home/work/shared/dybocryp/test'
+Compiling test.c
+Compiling dcttkmod.c
+Compiling dctcaesa.c
+Compiling dcthash.c
+Compiling dcthash.c
+Compiling dcthash.c
+Compiling dcthash.c
+Compiling dcthshln.c
+Linking test
+make[1]: Leaving directory `/home/work/shared/dybocryp/test'
+cd test && perl -w ../../scripts/maker.pl gnu -f GNUmakefile run
+Daybo Logic DayboCrypt Maker - Version 0.4 (20040617)
+Can't exec "gmake": No such file or directory at ../../scripts/maker.pl line 85.
+make[1]: Entering directory `/home/work/shared/dybocryp/test'
+./test
+DayboCrypt - intensive test suite.  (C)2002-2004 Daybo Logic, all rights
+reserved.    http://www.daybologic.co.uk/    Released under BSD license.
+Using DayboCrypt V1.0.2
+
+Total Konfuzion's modulator
+	(C) 2002 digiServ Web Solutions,
+	used with permission.
+RSA Data Security, Inc. MD2 Message-Digest Algorithm (for non-commercial use)
+RSA Data Security, Inc. MD4 Message-Digest Algorithm
+RSA Data Security, Inc. MD5 Message-Digest Algorithm
+US Secure Hash Algorithm 1 (SHA1)
+	Copyright (C) The Internet Society (2001).
+	All Rights Reserved.
+
+
+Testing Hash length support functions(s)...OK
+Testing Total Konfuzion modulator...OK
+Testing DDRP - Caesar's Cipher...OK
+Testing RSA MD2 message Digest Algorithm...OK
+Testing RSA MD4 message Digest Algorithm...OK
+Testing RSA MD5 Message Digest Algorithm...OK
+Testing NSA SHA-1 Secure Hash Algorithm...OK
+
+No failures detected.
+
+make[1]: Leaving directory `/home/work/shared/dybocryp/test'
+overlord@torvalds:~/work/shared/dybocryp$ exit
+Script done on Fri Jun 18 14:32:00 2004

Docs/build/output/readme.txt

+The files in this directory illustrate a typical build output from the
+various supported compilers.  There were no warnings under my build
+except under FreeBSD.  The warnings under FreeBSD don't fall within my
+domain and it is up to the C library maintainers to fix them.  I would
+imagine that they have not attempted to use the number of warnings that
+I have.  If you become annoyed with the warnings, turn off -ansi in
+gnu.cfg

Docs/build/turboc.txt

+Readme for building DayboCrypt for use with Borland turbo C.
+This has been tested with Borland Turbo C++ 3.00
+
+The library is primarily maintained on Linux at time of writing,
+however, there shouldn't be a problem building the library on
+Turbo C under pure DOS.  Unfortunately, at time of writing, the
+Perl scripts to build the system run out of memory while trying
+to build the library.  So, here are some brief instructions.
+
+First of all, in the main directory, run:
+maker -DCC=tcc -f Makefile.bor
+
+If the library builds successfully, run bldlib (bldlib.bat)
+This should call Turbo Librarian.
+If this completes successfully, go to the test directory and run
+the maker command above again.
+
+Now run test.exe
+
+When I tried this, I got 7 failures, all from SHA-1.
+I don't know why this might be at the moment but it seems the other
+algorithms work, according to the test suite.
+# $Id: GNUmakefile,v 0.3 2004/06/12 15:19:00 ddrp Rel $
+#
+# Makefile for main crypto library.
+# DayboCrypt - (C) Copyright 2002-2004 David Duncan Ross Palmer,
+# Daybo Logic, All Rights Reserved.
+#
+# http://www.daybologic.co.uk/
+
+include gnu.cfg
+
+LOCALMAKE=perl -w ../../scripts/maker.pl $(PLATFORMID)
+THISFILE=GNUmakefile
+ERASE=perl -w ../scripts/erase.pl
+MAKELIB=perl -w ../scripts/libtool.pl $(PLATFORMID)
+
+
+LIBRARY=libdybocryp$(LIB)
+
+OBJS=dctkmod$(O) \
+     dccaesar$(O) \
+     dcmd2$(O) \
+     dcmd4$(O) \
+     dcmd5$(O) \
+     dcsha1$(O) \
+     dchshcmp$(O) \
+     dchshlen$(O) \
+     dybocryp$(O)
+
+all : test
+
+run : test
+	cd test && $(LOCALMAKE) -f $(THISFILE) run
+
+test : library
+	cd test && $(LOCALMAKE) -f $(THISFILE)
+
+clean_test:
+	cd test && $(LOCALMAKE) -f $(THISFILE) clean
+
+library : $(LIBRARY)
+
+$(C)$(O):
+	@echo compiling $<
+	@$(CC) -c $(CFLAGS) $<
+
+clean_library:
+	-$(ERASE) $(OBJS) $(LIBRARY)
+
+$(LIBRARY) : $(OBJS)
+	$(MAKELIB) $(LIBRARY) $(OBJS)
+
+clean : clean_library clean_test
+
+depend:
+	@echo No dependencies to keep it portable
+
+install : $(LIBRARY)
+	cp $(LIBRARY) $(USRLIB)
+	chown root:root $(USRLIB)$(LIBRARY)
+	chmod 444 $(USRLIB)$(LIBRARY)
+
+	cp dybocryp$(H) $(USRINC)
+	chown root:root $(USRINC)dybocryp$(H)
+	chmod 444 $(USRINC)dybocryp$(H)
+
+	cp daybocrypt$(H) $(USRINC)
+	chown root:root $(USRINC)daybocrypt$(H)
+	chmod 444 $(USRINC)daybocrypt$(H)
+
+uninstall:
+	rm -f $(USRINC)daybocrypt$(H)
+	rm -f $(USRINC)dybocryp$(H)
+	rm -f $(USRLIB)$(LIBRARY)
+$Id: LICENSE,v 0.1 2004/02/23 18:08:00 ddrp Rel $
+
+Copyright (C) 2002-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+NOTE: There are also license restrictions on various algorithms which will 
+need to be taken into account.  Read license notes in individual files'
+source if you will be using functions within those files.
+@echo off
+echo Building DayboCrypt using default Borland compiler settings
+make -f Makefile.bor run
+@echo off
+echo Building DayboCrypt using Borland 32-bit compiler...
+Make -DBCC32=1 -f Makefile.bor run
+@echo off
+echo This script is a hack to get the library built for Turbo C
+if exist dybocryp.lib erase dybocryp.lib
+tlib dybocryp.lib +dybocryp.obj
+tlib dybocryp.lib +dctkmod.obj
+tlib dybocryp.lib +dccaesar.obj
+tlib dybocryp.lib +dcmd2.obj
+tlib dybocryp.lib +dcmd4.obj
+tlib dybocryp.lib +dcmd5.obj
+tlib dybocryp.lib +dcsha1.obj
+tlib dybocryp.lib +dchshcmp.obj
+tlib dybocryp.lib +dchshlen.obj
+#
+# Borland compiler configuration, include by Makefile.bor
+#
+# $Id: borland.cfg,v 0.4 2004/06/12 15:45:30 ddrp Rel $
+#
+# Copyright (C) 2004 Daybo Logic.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# NOTE: There are also license restrictions on various algorithms which will
+# need to be taken into account.  Read license notes in individual files'
+# source if you will be using functions within those files.
+#
+#
+
+!ifdef BCC32     # Want 32-bit compilation forced?
+CC=bcc32
+!endif
+
+!ifndef CC       # No default compiler?
+CC=bcc           # Assume basic Borland compiler
+!endif
+
+# File extensions
+C=.c
+H=.h
+LIB=.lib
+EXE=.exe
+O=.obj
+
+# Paths to install to (nothing on Borland/Win32/DOS)
+# Warning: Ending slashes _must_ be present!
+USRINC=
+USRLIB=
+
+!ifdef DEBUG
+DBG=-v
+!else
+DBG=
+!endif
+
+ANSI=-A
+BASIC_CFLAGS=$(ANSI)
+CFLAGS=$(BASIC_CFLAGS) $(DBG)
+PLATFORMID=bor
+@echo off
+cls
+echo $Id: build.bat,v 0.4 2004/03/21 17:00:00 ddrp Rel $
+
+rem Copyright (C) 2002-2004 Daybo Logic.
+rem All rights reserved.
+
+rem Redistribution and use in source and binary forms, with or without
+rem modification, are permitted provided that the following conditions
+rem are met:
+rem 1. Redistributions of source code must retain the above copyright
+rem    notice, this list of conditions and the following disclaimer.
+rem 2. Redistributions in binary form must reproduce the above copyright
+rem    notice, this list of conditions and the following disclaimer in the
+rem    documentation and/or other materials provided with the distribution.
+rem 3. Neither the name of the project nor the names of its contributors
+rem    may be used to endorse or promote products derived from this software
+rem    without specific prior written permission.
+
+rem THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+rem ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+rem IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+rem ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+rem FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+rem DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+rem OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+rem HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+rem OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+rem SUCH DAMAGE.
+
+rem NOTE: There are also license restrictions on various algorithms which will 
+rem need to be taken into account.  Read license notes in individual files'
+rem source if you will be using functions within those files.
+
+echo Welcome to DayboCrypt!
+echo Please make sure you understand all the license
+echo implications for all the algorithms you wish to use from
+echo this library.
+echo.
+echo We will now begin building this library.  This will
+echo fail if you do not have Perl installed and on the path.
+echo You will need to answer a few questions, I have kept this
+echo to a minimum because I realise you are busy.
+echo If the script hangs on loading Perl, you have not set up
+echo the perllib_prefix environment variable (this applies to
+echo the DOS version of Perl only).
+echo.
+
+echo Loading Perl...
+perl build.pl
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2002-2004 Daybo Logic.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# NOTE: There are also license restrictions on various algorithms which will
+# need to be taken into account.  Read license notes in individual files'
+# source if you will be using functions within those files.
+#
+
+my $input;
+
+print "Please select one of the following supported compilers\n";
+print "if you do not see your compiler listed, press 0 and build\n";
+print "the library yourself.\n";
+
+do {
+  print "0) You don\'t support my compiler\n";
+  print "1) Borland Turbo C for DOS\n";
+  print "2) Borland C\n";
+  print "3) Watcom C\n";
+  print "4) GNU C\n";
+  print "\n";
+
+  print "Press a number, followed by [ENTER] >";
+  $input = <STDIN>;
+  chomp($input);
+  if ( $input eq "0" ) {
+    print "Exiting\n";
+    exit(0);
+  }
+  elsif ( $input eq "1" ) {
+    exec "maker -DCC=tcc -f Makefile.bor run";
+    exit(0);
+  }
+  elsif ( $input eq "2" ) {
+    system "make -f Makefile.bor run";
+    exit(0);
+  }
+  elsif ( $input eq "3" ) {
+    print "I am sorry, Watcom config was out of date and was removed\n";
+    system "wmake -f Makefile.wat";
+    exit(0);
+  }
+  elsif ( $input eq "4" ) {
+    if ( system("gmake run") == -1 ) {
+      system "make run";
+    }
+    exit(0);
+  }
+
+  print "$input is not a valid selection.\n\n";
+} while ( 1 );
+#!/bin/sh
+
+perl -w build.pl
+@echo off
+rem $Id: config.bat,v 0.1 2004/02/23 18:08:00 ddrp Rel $
+
+rem Copyright (C) 2002-2004 Daybo Logic.
+rem All rights reserved.
+
+rem Redistribution and use in source and binary forms, with or without
+rem modification, are permitted provided that the following conditions
+rem are met:
+rem 1. Redistributions of source code must retain the above copyright
+rem    notice, this list of conditions and the following disclaimer.
+rem 2. Redistributions in binary form must reproduce the above copyright
+rem    notice, this list of conditions and the following disclaimer in the
+rem    documentation and/or other materials provided with the distribution.
+rem 3. Neither the name of the project nor the names of its contributors
+rem    may be used to endorse or promote products derived from this software
+rem    without specific prior written permission.
+
+rem THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+rem ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+rem IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+rem ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+rem FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+rem DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+rem OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+rem HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+rem OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+rem SUCH DAMAGE.
+
+rem NOTE: There are also license restrictions on various algorithms which will 
+rem need to be taken into account.  Read license notes in individual files'
+rem source if you will be using functions within those files.
+
+echo There is no configure utility as yet. 
+echo Please run build.bat, this will
+echo compile the library with either Borland C, GNU C, Turbo C
+echo or Watcom C.  You must have Perl installed to do this.
+/*
+  DayboCrypt
+  Portions (C) Copyright 2004 David Duncan Ross Palmer, Daybo Logic,
+  all rights reserved.
+
+  http://www.daybologic.co.uk/
+
+  This file is a wrapper for code which wants to use the header
+  "daybocrypt.h" for legibillity reasons.  It includes the DOS
+  naming convention-compatible header "dybocryp.h" only.  No other
+  functionallity is added.  If you are reading this header because of
+  an error, it is because you used a direct path to include
+  daybocrypt.h, ie #include "/usr/local/include/daybocrypt.h", you should
+  not do this.  You should add the library's directory to your compiler
+  inclusion path.
+*/
+
+#include "dybocryp.h"
+/*
+  DayboCrypt
+  http://www.daybologic.co.uk/
+
+Copyright (C) 2002-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+NOTE: There are also license restrictions on various algorithms which will
+need to be taken into account.  Read license notes in individual files'
+source if you will be using functions within those files.
+
+
+  Caesar's Cipher was a cipher invented by Julius Caesar.  It simple offsets
+  the alphabet by the key, therefore key 26 is equal to key 0, neither of
+  which are acceptable to my version of the routine.  One must specify
+  enciphering or deciphering to my routine.  It was also used during the
+  American civil war and would give a few hours protection.  It is probally
+  one of the weakest ciphers, with a choice of only 25 keys.  No characters
+  but a-z or A-Z are touched.  Leaving sentence structures intact.
+*/
+
+#define DAYBOCRYPT_CORE
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+
+#include "dybocryp.h"
+/*-------------------------------------------------------------------------*/
+static const char *const rcsid = "$Id: dccaesar.c,v 0.3 2004/03/06 16:50:00 ddrp Rel $";
+/*-------------------------------------------------------------------------*/
+DAYBOCRYPT_API(enum caesarReturn) daybocrypt_CaesarCipher(
+  enum caesarCipherMode Mode,
+  char* Text,
+  const unsigned int Key
+)
+{
+  unsigned int len, i;
+
+  /* Check params */
+  if ( !Text || !Key || Key >= 26 )
+    return caesarInvalidParam;
+
+  len = strlen(Text);
+  for ( i = 0U; i < len; i++ ) {
+    if ( ( Text[i] >= 'A' && Text[i] <= 'Z' ) || ( Text[i] >= 'a' && Text[i] <= 'z' ) ) {
+      int bool_wasupper = 0;
+      char _char;
+
+      if ( isupper(Text[i]) ) {
+        bool_wasupper = 1;
+        Text[i] = (char)tolower((unsigned int)Text[i]);
+      }
+
+      _char = (char)(Text[i] - 'a'); /* Offset the letter to the standard alphabet */
+      /* Do cipher */
+      if ( Mode == ccmEncipher )
+        _char = (char)(( _char + Key ) % 26);
+      else { /* Decipher, slightly more hassle, can't make use of modulo */
+        signed char _newchar = (signed char)(_char - Key);
+        if ( _newchar < 0 ) { /* Underflow */
+          _newchar++; /* Make into reverse offset from z */
+          _char = (char)(('z' - 'a') + _newchar); /* Note: addition of megative number meaning subtract */
+        }
+        else
+          _char = (char)_newchar;
+      }
+
+      _char = (char)(_char + 'a'); /* Put alphabet back into ASCII range */
+      /* Restore case */
+      if ( bool_wasupper )
+        _char = (char)toupper((unsigned int)_char);
+
+      Text[i] = _char;
+    }
+  }
+
+  return caesarSuccess;
+}
+/*-------------------------------------------------------------------------*/
+DAYBOCRYPT_API(unsigned int) daybocrypt_CaesarKeyGen(const char* Passphrase)
+{
+  unsigned int i, l, key = 0U;
+
+  if ( Passphrase ) {
+    l = strlen(Passphrase);
+    for ( i = 0U; i < l; i++ )
+      key += (unsigned int)Passphrase[i];
+
+    key = key % 26;
+    if ( !key ) key = 1;
+  }
+
+  return key;
+}
+/*-------------------------------------------------------------------------*/
+DAYBOCRYPT_API(const char*) daybocrypt_CaesarGetLegalString()
+{
+  /*
+    Caesar's cipher is one of the oldest ciphers in the world, so we
+    don't need a copyright string, unless we were going to say copyright
+    Julius Caesar or something!
+  */
+  return NULL;
+}
+/*-------------------------------------------------------------------------*/
+#ifndef INC_DAYBOCRYPT_DCCAESAR_H
+#define INC_DAYBOCRYPT_DCCAESAR_H
+
+enum caesarReturn {
+  caesarInvalidParam,
+  caesarSuccess
+};
+
+enum caesarCipherMode {
+  ccmEncipher,
+  ccmDecipher
+};
+
+#ifdef __cplusplus
+  extern "C" {
+#endif /*__cplusplus*/
+
+enum caesarReturn daybocrypt_CaesarCipher(enum caesarCipherMode Mode, char* Text, const unsigned int Key);
+unsigned int daybocrypt_CaesarKeyGen(const char* Passphrase); /* Returns key */
+
+const char* daybocrypt_CaesarGetLegalString(void); /* Would return a legal string if we cared enough */
+
+#ifdef __cplusplus
+  } /* extern "C" */
+#endif /*__cplusplus*/
+
+#endif /*!INC_DAYBOCRYPT_DCCAESAR_H*/
+/*
+  DayboCrypt
+  http://www.daybologic.co.uk/
+
+Copyright (C) 2002-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+NOTE: There are also license restrictions on various algorithms which will
+need to be taken into account.  Read license notes in individual files'
+source if you will be using functions within those files.
+
+*/
+
+#define DAYBOCRYPT_CORE
+#include <stddef.h>
+#include <limits.h>
+
+#include "dybocryp.h"
+/*-------------------------------------------------------------------------*/
+static const char *const rcsid = "$Id: dchshcmp.c,v 0.3 2004/03/06 16:51:00 ddrp Rel $";
+/*-------------------------------------------------------------------------*/
+DAYBOCRYPT_API(int) daybocrypt_CompareDigests(
+  const unsigned char* Digest1,
+  const unsigned char* Digest2,
+  const size_t DigestSize
+)
+{
+  size_t i;
+
+  if ( Digest1 == Digest2 ) return 1; /* Obviously if both the same pointer */
+  if ( !Digest1 || !Digest2 ) return 0; /* Obviously not if either a NULL pointer */
+
+  /* Go for the comparison */
+  for ( i = 0; i < DigestSize; i++ ) {
+    if ( Digest1[i] != Digest2[i] )
+      return 0; /* Mismatch */
+  }
+  return 1; /* OK */
+}
+/*
+  Digest comparison fuinctions.
+*/
+
+#ifndef INC_DAYBOCRYPT_HASHCOMPARE_H
+#define INC_DAYBOCRYPT_HASHCOMPARE_H
+
+#ifdef __cplusplus
+  extern "C" {
+#endif /*__cplusplus*/
+
+int daybocrypt_CompareDigests PROTO_LIST ((const unsigned char* Digest1, const unsigned char* Digest2, const size_t DigestSize)); /* Returns 1 if comparison is OK, zero on failure */
+
+#ifdef __cplusplus
+  }
+#endif /*__cplusplus*/
+
+#endif /*!INC_DAYBOCRYPT_HASHCOMPARE_H*/
+/*
+  DayboCrypt
+  http://www.daybologic.co.uk/
+
+Copyright (C) 2002-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+NOTE: There are also license restrictions on various algorithms which will
+need to be taken into account.  Read license notes in individual files'
+source if you will be using functions within those files.
+
+*/
+
+#define DAYBOCRYPT_CORE
+#include <stddef.h>
+#include <limits.h>
+
+#include "dybocryp.h"
+/*-------------------------------------------------------------------------*/
+static const char *const rcsid = "$Id: dchshlen.c,v 0.3 2004/03/04 14:13:00 ddrp Rel $";
+/*-------------------------------------------------------------------------*/
+DAYBOCRYPT_API(size_t) daybocrypt_DigestLengthFromType(
+  const enum daybocrypt_owhf DigestType
+)
+{
+  switch ( DigestType ) {
+    case owhfMd2 :
+      return DAYBOCRYPT_MD2HASHLEN;
+    case owhfMd4 :
+      return DAYBOCRYPT_MD4HASHLEN;
+    case owhfMd5 :
+      return DAYBOCRYPT_MD5HASHLEN;
+    case owhfSha1 :
+      return DAYBOCRYPT_SHA1HASHLEN;
+  };
+
+  return 0;
+}
+/*-------------------------------------------------------------------------*/
+/*
+  DayboCrypt
+  Portions Copyrigyht 2004 David Duncan Ross Palmer,
+  Daybo Logic, all rights reserved.
+
+  http://www.daybologic.co.uk/
+*/
+
+
+
+/* MD2C.C - RSA Data Security, Inc., MD2 message-digest algorithm
+ */
+
+/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
+   rights reserved.
+
+   License to copy and use this software is granted for
+   non-commercial Internet Privacy-Enhanced Mail provided that it is
+   identified as the "RSA Data Security, Inc. MD2 Message Digest
+   Algorithm" in all material mentioning or referencing this software
+   or this function.
+
+   RSA Data Security, Inc. makes no representations concerning either
+   the merchantability of this software or the suitability of this
+   software for any particular purpose. It is provided "as is"
+   without express or implied warranty of any kind.
+
+   These notices must be retained in any copies of any part of this
+   documentation and/or software.
+ */
+
+#define DAYBOCRYPT_CORE
+#include <stddef.h>
+#include <limits.h>
+#include <string.h> /* For memcpy() and memset() */
+
+#include "dybocryp.h" /* Master library header */
+/*-------------------------------------------------------------------------*/
+static const char *const rcsid = "$Id: dcmd2.c,v 0.3 2004/06/18 12:35:00 ddrp Rel $";
+
+typedef unsigned char *POINTER;
+
+static void MD2Transform(
+  unsigned char [16],
+  unsigned char [16],
+  const unsigned char [16]
+);
+
+/* Permutation of 0..255 constructed from the digits of pi. It gives a
+   "random" nonlinear byte substitution operation.
+ */
+static unsigned char PI_SUBST[256] = {
+  41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
+  19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
+  76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
+  138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
+  245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
+  148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
+  39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
+  181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
+  150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
+  112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
+  96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
+  85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
+  234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
+  129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
+  8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
+  203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
+  166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
+  31, 26, 219, 153, 141, 51, 159, 17, 131, 20
+};
+
+static const unsigned char *const PADDING[] = {
+  (const unsigned char *)"",
+  (const unsigned char *)"\001",
+  (const unsigned char *)"\002\002",
+  (const unsigned char *)"\003\003\003",
+  (const unsigned char *)"\004\004\004\004",
+  (const unsigned char *)"\005\005\005\005\005",
+  (const unsigned char *)"\006\006\006\006\006\006",
+  (const unsigned char *)"\007\007\007\007\007\007\007",
+  (const unsigned char *)"\010\010\010\010\010\010\010\010",
+  (const unsigned char *)"\011\011\011\011\011\011\011\011\011",
+  (const unsigned char *)"\012\012\012\012\012\012\012\012\012\012",
+  (const unsigned char *)"\013\013\013\013\013\013\013\013\013\013\013",
+  (const unsigned char *)"\014\014\014\014\014\014\014\014\014\014\014\014",
+  (const unsigned char *)
+    "\015\015\015\015\015\015\015\015\015\015\015\015\015",
+  (const unsigned char *)
+    "\016\016\016\016\016\016\016\016\016\016\016\016\016\016",
+  (const unsigned char *)
+    "\017\017\017\017\017\017\017\017\017\017\017\017\017\017\017",
+  (const unsigned char *)
+    "\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020"
+};
+
+/* MD2 initialization. Begins an MD2 operation, writing a new context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD2Init (context)
+MD2_CTX *context;                                        /* context */
+{
+ context->count = 0;
+  memset ((POINTER)context->state, 0, sizeof (context->state));
+  memset
+    ((POINTER)context->checksum, 0, sizeof (context->checksum));
+}
+
+/* MD2 block update operation. Continues an MD2 message-digest
+     operation, processing another message block, and updating the
+     context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD2Update (context, input, inputLen)
+MD2_CTX *context;                                        /* context */
+const unsigned char *input;                          /* input block */
+unsigned int inputLen;                     /* length of input block */
+{
+  unsigned int i, idx, partLen;
+
+  /* Update number of bytes mod 16 */
+  idx = context->count;
+  context->count = (idx + inputLen) & 0xf;
+
+  partLen = 16 - idx;
+
+  /* Transform as many times as possible.
+    */
+  if (inputLen >= partLen) {
+    memcpy
+      ((POINTER)&context->buffer[idx], input, partLen);
+    MD2Transform (context->state, context->checksum, context->buffer);
+
+    for (i = partLen; i + 15 < inputLen; i += 16)
+      MD2Transform (context->state, context->checksum, &input[i]);
+
+    idx = 0;
+  }
+  else
+    i = 0;
+
+  /* Buffer remaining input */
+  memcpy
+    ((POINTER)&context->buffer[idx], &input[i],
+     inputLen-i);
+}
+
+/* MD2 finalization. Ends an MD2 message-digest operation, writing the
+     message digest and zeroizing the context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD2Final (digest, context)
+unsigned char digest[16];                         /* message digest */
+MD2_CTX *context;                                        /* context */
+{
+  unsigned int idx, padLen;
+
+  /* Pad out to multiple of 16.
+   */
+  idx = context->count;
+  padLen = 16 - idx;
+  daybocrypt_MD2Update(
+    context,
+    PADDING[padLen],
+    padLen
+  );
+
+  /* Extend with checksum */
+  daybocrypt_MD2Update (context, context->checksum, 16);
+
+  /* Store state in digest */
+  memcpy ((POINTER)digest, (POINTER)context->state, 16);
+
+  /* Zeroize sensitive information.
+   */
+  memset ((POINTER)context, 0, sizeof (*context));
+}
+
+/* MD2 basic transformation. Transforms state and updates checksum
+     based on block.
+ */
+static void MD2Transform(
+  unsigned char state[16],
+  unsigned char checksum[16],
+  const unsigned char block[16]
+)
+{
+  unsigned int i, j, t;
+  unsigned char x[48];
+
+  /* Form encryption block from state, block, state ^ block.
+   */
+  memcpy ((POINTER)x, (POINTER)state, 16);
+  memcpy ((POINTER)x+16, block, 16);
+  for (i = 0; i < 16; i++)
+    x[i+32] = state[i] ^ block[i];
+
+  /* Encrypt block (18 rounds).
+   */
+  t = 0;
+  for (i = 0; i < 18; i++) {
+    for (j = 0; j < 48; j++)
+      t = x[j] ^= PI_SUBST[t];
+    t = (t + i) & 0xff;
+  }
+ /* Save new state */
+  memcpy ((POINTER)state, (POINTER)x, 16);
+
+  /* Update checksum.
+   */
+  t = checksum[15];
+  for (i = 0; i < 16; i++)
+    t = checksum[i] ^= PI_SUBST[block[i] ^ t];
+
+  /* Zeroize sensitive information.
+   */
+  memset ((POINTER)x, 0, sizeof (x));
+}
+
+DAYBOCRYPT_API(const char*) daybocrypt_MD2GetLegalString()
+{
+  static const char legalString[] = "RSA Data Security, Inc. MD2 Message-Digest Algorithm (for non-commercial use)";
+  return legalString;
+}
+/* MD2.H - header file for MD2C.C
+ */
+
+/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
+   rights reserved.
+
+   License to copy and use this software is granted for
+   non-commercial Internet Privacy-Enhanced Mail provided that it is
+   identified as the "RSA Data Security, Inc. MD2 Message Digest
+   Algorithm" in all material mentioning or referencing this software
+   or this function.
+
+   RSA Data Security, Inc. makes no representations concerning either
+   the merchantability of this software or the suitability of this
+   software for any particular purpose. It is provided "as is"
+   without express or implied warranty of any kind.
+
+   These notices must be retained in any copies of any part of this
+   documentation and/or software.
+ */
+
+#ifndef INC_DAYBOCRYPT_MD2_H
+#define INC_DAYBOCRYPT_MD2_H
+
+typedef struct {
+  unsigned char state[16];                                 /* state */
+  unsigned char checksum[16];                           /* checksum */
+  unsigned int count;                 /* number of bytes, modulo 16 */
+  unsigned char buffer[16];                         /* input buffer */
+} MD2_CTX;
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+
+void daybocrypt_MD2Init PROTO_LIST ((MD2_CTX *));
+void daybocrypt_MD2Update PROTO_LIST ((MD2_CTX *, unsigned char *, unsigned int));
+void daybocrypt_MD2Final PROTO_LIST ((unsigned char [DAYBOCRYPT_MD2HASHLEN], MD2_CTX *));
+
+const char* daybocrypt_MD2GetLegalString(void);
+
+#if ( DAYBOCRYPT_MD2HASHLEN == 16 )
+# define daybocrypt_MD2CompareDigests(d1, d2) \
+           daybocrypt_CompareDigests((d1), (d2), (DAYBOCRYPT_MD2HASHLEN))
+#endif
+
+#ifdef __cplusplus
+  }
+#endif
+
+#endif /*!INC_DAYBOCRYPT_MD2_H*/
+/*
+  DayboCrypt
+  Portions (C) Copyright 2004, David Duncan Ross Palmer,
+  Daybo Logic, all rights reserved.
+
+  http://www.daybologic.co.uk/
+*/
+
+
+
+/* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm
+ */
+
+/* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
+
+   License to copy and use this software is granted provided that it
+   is identified as the "RSA Data Security, Inc. MD4 Message-Digest
+   Algorithm" in all material mentioning or referencing this software
+   or this function.
+
+   License is also granted to make and use derivative works provided
+   that such works are identified as "derived from the RSA Data
+   Security, Inc. MD4 Message-Digest Algorithm" in all material
+   mentioning or referencing the derived work.
+
+   RSA Data Security, Inc. makes no representations concerning either
+   the merchantability of this software or the suitability of this
+   software for any particular purpose. It is provided "as is"
+   without express or implied warranty of any kind.
+
+   These notices must be retained in any copies of any part of this
+   documentation and/or software.
+ */
+
+#define DAYBOCRYPT_CORE
+#include <stddef.h>
+#include <limits.h>
+#include <string.h> /* memcpy() and memset() */
+
+#include "dybocryp.h" /* Library header */
+/*-------------------------------------------------------------------------*/
+static const char *const rcsid = "$Id: dcmd4.c,v 1.2 2004/06/18 12:36:00 ddrp Rel $";
+
+typedef unsigned char *POINTER;
+
+/* Constants for MD4Transform routine.
+ */
+#define S11 3
+#define S12 7
+#define S13 11
+#define S14 19
+#define S21 3
+#define S22 5
+#define S23 9
+#define S24 13
+#define S31 3
+#define S32 9
+#define S33 11
+#define S34 15
+
+static void MD4Transform(
+  uint32_t [4],
+  const unsigned char [64]
+);
+
+static void Encode(
+  unsigned char *,
+  uint32_t *,
+  unsigned int
+);
+
+static void Decode(
+  uint32_t *,
+  const unsigned char *,
+  unsigned int
+);
+
+static unsigned char PADDING[64] = {
+  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* F, G and H are basic MD4 functions.
+ */
+#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
+#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+
+/* ROTATE_LEFT rotates x left n bits.
+ */
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+
+/* FF, GG and HH are transformations for rounds 1, 2 and 3 */
+/* Rotation is separate from addition to prevent recomputation */
+#define FF(a, b, c, d, x, s) { \
+    (a) += F ((b), (c), (d)) + (x); \
+    (a) = ROTATE_LEFT ((a), (s)); \
+  }
+#define GG(a, b, c, d, x, s) { \
+    (a) += G ((b), (c), (d)) + (x) + (uint32_t)0x5a827999; \
+    (a) = ROTATE_LEFT ((a), (s)); \
+  }
+#define HH(a, b, c, d, x, s) { \
+    (a) += H ((b), (c), (d)) + (x) + (uint32_t)0x6ed9eba1; \
+    (a) = ROTATE_LEFT ((a), (s)); \
+  }
+
+/* MD4 initialization. Begins an MD4 operation, writing a new context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD4Init (context)
+MD4_CTX *context;                                        /* context */
+{
+  context->count[0] = context->count[1] = 0;
+
+  /* Load magic initialization constants.
+   */
+  context->state[0] = 0x67452301;
+  context->state[1] = 0xefcdab89;
+  context->state[2] = 0x98badcfe;
+  context->state[3] = 0x10325476;
+}
+
+/* MD4 block update operation. Continues an MD4 message-digest
+     operation, processing another message block, and updating the
+     context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD4Update (context, input, inputLen)
+MD4_CTX *context;                                        /* context */
+const unsigned char *input;                          /* input block */
+unsigned int inputLen;                     /* length of input block */
+{
+  unsigned int i, idx, partLen;
+
+  /* Compute number of bytes mod 64 */
+  idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
+  /* Update number of&bits */
+  if ((context->count[0] += ((uint32_t)inputLen << 3))
+      < ((uint32_t)inputLen << 3))
+    context->count[1]++;
+  context->count[1] += ((uint32_t)inputLen >> 29);
+
+  partLen = 64 - idx;
+  /* Transform as many times as possible.
+   */
+  if (inputLen >= partLen) {
+    memcpy
+      ((POINTER)&context->buffer[idx], input, partLen);
+    MD4Transform (context->state, context->buffer);
+
+    for (i = partLen; i + 63 < inputLen; i += 64)
+      MD4Transform (context->state, &input[i]);
+
+    idx = 0;
+  }
+  else
+    i = 0;
+
+  /* Buffer remaining input */
+  memcpy
+    ((POINTER)&context->buffer[idx], &input[i],
+     inputLen-i);
+}
+
+/* MD4 finalization. Ends an MD4 message-digest operation, writing the
+     the message digest and zeroizing the context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD4Final (digest, context)
+unsigned char digest[16];                         /* message digest */
+MD4_CTX *context;                                        /* context */
+{
+  unsigned char bits[8];
+  unsigned int idx, padLen;
+
+  /* Save number of bits */
+  Encode (bits, context->count, 8);
+
+  /* Pad out to 56 mod 64.
+   */
+  idx = (unsigned int)((context->count[0] >> 3) & 0x3f);
+  padLen = (idx < 56) ? (56 - idx) : (120 - idx);
+  daybocrypt_MD4Update (context, PADDING, padLen);
+
+  /* Append length (before padding) */
+  daybocrypt_MD4Update (context, bits, 8);
+  /* Store state in digest */
+  Encode (digest, context->state, 16);
+
+  /* Zeroize sensitive information.
+   */
+  memset ((POINTER)context, 0, sizeof (*context));
+}
+
+/* MD4 basic transformation. Transforms state based on block.
+ */
+static void MD4Transform(
+  uint32_t state[4],
+  const unsigned char block[64]
+)
+{
+  uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+
+  Decode (x, block, 64);
+
+  /* Round 1 */
+  FF (a, b, c, d, x[ 0], S11); /* 1 */
+  FF (d, a, b, c, x[ 1], S12); /* 2 */
+  FF (c, d, a, b, x[ 2], S13); /* 3 */
+  FF (b, c, d, a, x[ 3], S14); /* 4 */
+  FF (a, b, c, d, x[ 4], S11); /* 5 */
+  FF (d, a, b, c, x[ 5], S12); /* 6 */
+  FF (c, d, a, b, x[ 6], S13); /* 7 */
+  FF (b, c, d, a, x[ 7], S14); /* 8 */
+  FF (a, b, c, d, x[ 8], S11); /* 9 */
+  FF (d, a, b, c, x[ 9], S12); /* 10 */
+  FF (c, d, a, b, x[10], S13); /* 11 */
+  FF (b, c, d, a, x[11], S14); /* 12 */
+  FF (a, b, c, d, x[12], S11); /* 13 */
+  FF (d, a, b, c, x[13], S12); /* 14 */
+  FF (c, d, a, b, x[14], S13); /* 15 */
+  FF (b, c, d, a, x[15], S14); /* 16 */
+
+  /* Round 2 */
+  GG (a, b, c, d, x[ 0], S21); /* 17 */
+  GG (d, a, b, c, x[ 4], S22); /* 18 */
+  GG (c, d, a, b, x[ 8], S23); /* 19 */
+  GG (b, c, d, a, x[12], S24); /* 20 */
+  GG (a, b, c, d, x[ 1], S21); /* 21 */
+  GG (d, a, b, c, x[ 5], S22); /* 22 */
+  GG (c, d, a, b, x[ 9], S23); /* 23 */
+  GG (b, c, d, a, x[13], S24); /* 24 */
+  GG (a, b, c, d, x[ 2], S21); /* 25 */
+  GG (d, a, b, c, x[ 6], S22); /* 26 */
+  GG (c, d, a, b, x[10], S23); /* 27 */
+  GG (b, c, d, a, x[14], S24); /* 28 */
+  GG (a, b, c, d, x[ 3], S21); /* 29 */
+  GG (d, a, b, c, x[ 7], S22); /* 30 */
+  GG (c, d, a, b, x[11], S23); /* 31 */
+  GG (b, c, d, a, x[15], S24); /* 32 */
+ /* Round 3 */
+  HH (a, b, c, d, x[ 0], S31); /* 33 */
+  HH (d, a, b, c, x[ 8], S32); /* 34 */
+  HH (c, d, a, b, x[ 4], S33); /* 35 */
+  HH (b, c, d, a, x[12], S34); /* 36 */
+  HH (a, b, c, d, x[ 2], S31); /* 37 */
+  HH (d, a, b, c, x[10], S32); /* 38 */
+  HH (c, d, a, b, x[ 6], S33); /* 39 */
+  HH (b, c, d, a, x[14], S34); /* 40 */
+  HH (a, b, c, d, x[ 1], S31); /* 41 */
+  HH (d, a, b, c, x[ 9], S32); /* 42 */
+  HH (c, d, a, b, x[ 5], S33); /* 43 */
+  HH (b, c, d, a, x[13], S34); /* 44 */
+  HH (a, b, c, d, x[ 3], S31); /* 45 */
+  HH (d, a, b, c, x[11], S32); /* 46 */
+  HH (c, d, a, b, x[ 7], S33); /* 47 */
+  HH (b, c, d, a, x[15], S34); /* 48 */
+
+  state[0] += a;
+  state[1] += b;
+  state[2] += c;
+  state[3] += d;
+
+  /* Zeroize sensitive information.
+   */
+  memset ((POINTER)x, 0, sizeof (x));
+}
+
+/* Encodes input (UINT4) into output (unsigned char). Assumes len is
+     a multiple of 4.
+ */
+static void Encode (output, input, len)
+unsigned char *output;
+uint32_t *input;
+unsigned int len;
+{
+  unsigned int i, j;
+
+  for (i = 0, j = 0; j < len; i++, j += 4) {
+    output[j] = (unsigned char)(input[i] & 0xff);
+    output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
+    output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
+    output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
+  }
+}
+
+/* Decodes input (unsigned char) into output (UINT4). Assumes len is
+     a multiple of 4.
+*/
+static void Decode (output, input, len)
+
+uint32_t *output;
+const unsigned char *input;
+unsigned int len;
+{
+  unsigned int i, j;
+
+  for (i = 0, j = 0; j < len; i++, j += 4)
+    output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) |
+      (((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24);
+}
+
+DAYBOCRYPT_API(const char*) daybocrypt_MD4GetLegalString()
+{
+  static const char legalString[] = "RSA Data Security, Inc. MD4 Message-Digest Algorithm";
+  return legalString;
+}
+/* MD4.H - header file for MD4C.C
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+   rights reserved.
+
+   License to copy and use this software is granted provided that it
+   is identified as the "RSA Data Security, Inc. MD4 Message-Digest
+   Algorithm" in all material mentioning or referencing this software
+   or this function.
+
+   License is also granted to make and use derivative works provided
+   that such works are identified as "derived from the RSA Data
+   Security, Inc. MD4 Message-Digest Algorithm" in all material
+   mentioning or referencing the derived work.
+
+   RSA Data Security, Inc. makes no representations concerning either
+   the merchantability of this software or the suitability of this
+   software for any particular purpose. It is provided "as is"
+   without express or implied warranty of any kind.
+
+   These notices must be retained in any copies of any part of this
+   documentation and/or software.
+ */
+
+#ifndef INC_DAYBOCRYPT_MD4_H
+#define INC_DAYBOCRYPT_MD4_H
+
+/* MD4 context. */
+typedef struct {
+  UINT4 state[4];                                   /* state (ABCD) */
+  UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
+  unsigned char buffer[64];                         /* input buffer */
+} MD4_CTX;
+
+#ifdef __cplusplus
+  extern "C" {
+#endif /*__cplusplus*/
+
+void daybocrypt_MD4Init PROTO_LIST ((MD4_CTX *));
+void daybocrypt_MD4Update PROTO_LIST ((MD4_CTX *, unsigned char *, unsigned int));
+void daybocrypt_MD4Final PROTO_LIST ((unsigned char [DAYBOCRYPT_MD4HASHLEN], MD4_CTX *));
+
+const char* daybocrypt_MD4GetLegalString(void);
+
+#if ( DAYBOCRYPT_MD4HASHLEN == 16 )
+# define daybocrypt_MD4CompareDigests(d1, d2) \
+           daybocrypt_CompareDigests((d1), (d2), (DAYBOCRYPT_MD4HASHLEN))
+#endif
+
+#ifdef __cplusplus
+  }
+#endif /*__cplusplus*/
+
+#endif /*!INC_DAYBOCRYPT_MD4_H*/
+/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+rights reserved.
+
+License to copy and use this software is granted provided that it
+is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+Algorithm" in all material mentioning or referencing this software
+or this function.
+
+License is also granted to make and use derivative works provided
+that such works are identified as "derived from the RSA Data
+Security, Inc. MD5 Message-Digest Algorithm" in all material
+mentioning or referencing the derived work.
+
+RSA Data Security, Inc. makes no representations concerning either
+the merchantability of this software or the suitability of this
+software for any particular purpose. It is provided "as is"
+without express or implied warranty of any kind.
+
+These notices must be retained in any copies of any part of this
+documentation and/or software.
+
+This version of MD5 has been modified to fit into Daybo Logic's crypto
+library.  For more information, visit http://www.daybologic.co.uk/
+ */
+
+#define DAYBOCRYPT_CORE
+#include <stddef.h>
+#include <limits.h>
+#include <string.h>
+
+#include "dybocryp.h"
+/*-------------------------------------------------------------------------*/
+static const char *const rcsid = "$Id: dcmd5.c,v 1.2, 2004/03/21 17:23:10 ddrp Rel $";
+
+typedef unsigned char *POINTER;
+
+/* Constants for MD5Transform routine.
+ */
+
+
+#define S11 7
+#define S12 12
+#define S13 17
+#define S14 22
+#define S21 5
+#define S22 9
+#define S23 14
+#define S24 20
+#define S31 4
+#define S32 11
+#define S33 16
+#define S34 23
+#define S41 6
+#define S42 10
+#define S43 15
+#define S44 21
+
+static void MD5Transform(
+  uint32_t [4],
+  const unsigned char [64]
+);
+
+static void Encode(
+  unsigned char *,
+  uint32_t *,
+  unsigned int
+);
+
+static void Decode(
+  uint32_t *,
+  const unsigned char *,
+  unsigned int
+);
+
+static unsigned char PADDING[64] = {
+  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* F, G, H and I are basic MD5 functions.
+ */
+#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
+#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+#define I(x, y, z) ((y) ^ ((x) | (~z)))
+
+/* ROTATE_LEFT rotates x left n bits.
+ */
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+
+/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+Rotation is separate from addition to prevent recomputation.
+ */
+#define FF(a, b, c, d, x, s, ac) { \
+ (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+  }
+#define GG(a, b, c, d, x, s, ac) { \
+ (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+  }
+#define HH(a, b, c, d, x, s, ac) { \
+ (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+  }
+#define II(a, b, c, d, x, s, ac) { \
+ (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+  }
+
+/* MD5 initialization. Begins an MD5 operation, writing a new context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD5Init (context)
+MD5_CTX *context;                                        /* context */
+{
+  context->count[0] = context->count[1] = 0;
+  /* Load magic initialization constants.
+*/
+  context->state[0] = 0x67452301;
+  context->state[1] = 0xefcdab89;
+  context->state[2] = 0x98badcfe;
+  context->state[3] = 0x10325476;
+}
+
+/* MD5 block update operation. Continues an MD5 message-digest
+  operation, processing another message block, and updating the
+  context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD5Update (context, input, inputLen)
+MD5_CTX *context;                          /* context */
+const unsigned char *input;                /* input block */
+unsigned int inputLen;                     /* length of input block */
+{
+  unsigned int i, idx, partLen;
+
+  /* Compute number of bytes mod 64 */
+  idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
+
+  /* Update number of bits */
+  if ((context->count[0] += ((uint32_t)inputLen << 3))
+   < ((uint32_t)inputLen << 3))
+ context->count[1]++;
+  context->count[1] += ((uint32_t)inputLen >> 29);
+
+  partLen = 64 - idx;
+
+  /* Transform as many times as possible.
+*/
+  if (inputLen >= partLen) {
+    memcpy(
+      (POINTER)&context->buffer[idx],
+      input,
+      partLen
+    );
+    MD5Transform (context->state, context->buffer);
+
+    for (i = partLen; i + 63 < inputLen; i += 64)
+      MD5Transform (context->state, &input[i]);
+
+    idx = 0;
+  }
+  else
+    i = 0;
+
+  /* Buffer remaining input */
+  memcpy(
+    (POINTER)&context->buffer[idx],
+    &input[i],
+    inputLen-i
+  );
+}
+/*-------------------------------------------------------------------------*/
+/* MD5 finalization. Ends an MD5 message-digest operation, writing the
+  the message digest and zeroizing the context.
+ */
+DAYBOCRYPT_API(void) daybocrypt_MD5Final(
+  unsigned char digest[16],
+  MD5_CTX *context
+)
+{
+  unsigned char bits[8];
+  unsigned int idx, padLen;
+
+  /* Save number of bits */
+  Encode (bits, context->count, 8);
+
+  /* Pad out to 56 mod 64. */
+  idx = (unsigned int)((context->count[0] >> 3) & 0x3f);
+  padLen = (idx < 56) ? (56 - idx) : (120 - idx);
+  daybocrypt_MD5Update (context, PADDING, padLen);
+
+  /* Append length (before padding) */
+  daybocrypt_MD5Update (context, bits, 8);
+
+  /* Store state in digest */
+  Encode (digest, context->state, 16);
+
+  /* Zeroize sensitive information. */
+  memset ((POINTER)context, 0, sizeof (*context));
+}
+/*-------------------------------------------------------------------------*/
+/* MD5 basic transformation. Transforms state based on block.
+ */
+static void MD5Transform(
+  uint32_t state[4],
+  const unsigned char block[64]
+)
+{
+  uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+
+  Decode (x, block, 64);
+
+  /* Round 1 */
+  FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+  FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+  FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+  FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+  FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+  FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+  FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+  FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+  FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+  FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+  FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+  FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+  FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+  FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+  FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+  FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+
+ /* Round 2 */
+  GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+  GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+  GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+  GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+  GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+  GG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */
+  GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+  GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+  GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+  GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+  GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+  GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+  GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+  GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+  GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+  GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+
+  /* Round 3 */
+  HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+  HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+  HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+  HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+  HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+  HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+  HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+  HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+  HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+  HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+  HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+  HH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
+  HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+  HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+  HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+  HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+
+  /* Round 4 */
+  II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+  II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+  II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+  II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+  II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+  II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+  II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+  II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+  II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+  II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+  II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+  II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+  II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+  II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+  II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+  II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+
+  state[0] += a;
+  state[1] += b;
+  state[2] += c;
+  state[3] += d;
+
+  /* Zeroize sensitive information.
+   */
+  memset ((POINTER)x, 0, sizeof (x));
+}
+/*-------------------------------------------------------------------------*/
+/* Encodes input (uint32_t) into output (unsigned char). Assumes len is
+  a multiple of 4.
+ */
+static void Encode (output, input, len)
+unsigned char *output;
+uint32_t *input;
+unsigned int len;
+{
+  unsigned int i, j;
+
+  for (i = 0, j = 0; j < len; i++, j += 4) {
+ output[j] = (unsigned char)(input[i] & 0xff);
+ output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
+ output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
+ output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
+  }
+}
+/*-------------------------------------------------------------------------*/
+/* Decodes input (unsigned char) into output (uint32_t). Assumes len is
+  a multiple of 4.
+ */
+static void Decode (output, input, len)
+uint32_t *output;
+const unsigned char *input;
+unsigned int len;
+{
+  unsigned int i, j;
+
+  for (i = 0, j = 0; j < len; i++, j += 4)
+ output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) &