pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/digest Add support for the tiger algorithm to...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/37e180b45f4a
branches:  trunk
changeset: 491174:37e180b45f4a
user:      agc <agc%pkgsrc.org@localhost>
date:      Tue Mar 22 10:16:15 2005 +0000

description:
Add support for the tiger algorithm to digest.

Bump version to 20050310.

The cabal known as the cryptographers might like to have a look at the
first two results in test 6 of the regression tests.

diffstat:

 pkgtools/digest/DESCR              |   13 +-
 pkgtools/digest/files/Makefile.in  |    7 +-
 pkgtools/digest/files/configure    |    4 +-
 pkgtools/digest/files/configure.ac |    4 +-
 pkgtools/digest/files/digest.1     |    6 +-
 pkgtools/digest/files/digest.c     |    9 +-
 pkgtools/digest/files/regress.sh   |   14 +-
 pkgtools/digest/files/tiger.c      |  787 +++++++++++++++++++++++++++++++++++++
 pkgtools/digest/files/tiger.h      |   49 ++
 9 files changed, 880 insertions(+), 13 deletions(-)

diffs (truncated from 1014 to 300 lines):

diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/DESCR
--- a/pkgtools/digest/DESCR     Tue Mar 22 09:58:38 2005 +0000
+++ b/pkgtools/digest/DESCR     Tue Mar 22 10:16:15 2005 +0000
@@ -1,2 +1,11 @@
-This utility is a wrapper for the md5(3), rmd160(3), and sha1, sha256,
-sha384 and sha512 routines.
+This utility is a wrapper for the
+
+       + md5(3),
+       + rmd160(3),
+       + sha1(3),
+       + sha256,
+       + sha384
+       + sha512
+       + tiger
+
+message digest routines.
diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/files/Makefile.in
--- a/pkgtools/digest/files/Makefile.in Tue Mar 22 09:58:38 2005 +0000
+++ b/pkgtools/digest/files/Makefile.in Tue Mar 22 10:16:15 2005 +0000
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.2 2004/03/28 02:43:21 grant Exp $
+# $Id: Makefile.in,v 1.3 2005/03/22 10:16:15 agc Exp $
 
 @SET_MAKE@
 SHELL = @SHELL@
@@ -43,11 +43,11 @@
 COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS)
 
 digest_OBJS = digest.o md5c.o rmd160.o rmd160hl.o sha2.o sha2hl.o \
-md5hl.o sha1.o sha1hl.o
+md5hl.o sha1.o sha1hl.o tiger.o
 bits_OBJS = bits.o
 
 SRCS= digest.c md5c.c rmd160.c rmd160hl.c sha2.c sha2hl.c md5hl.c sha1.c \
-sha1hl.c bits.c md5.h rmd160.h sha1.h sha2.h
+sha1hl.c bits.c md5.h rmd160.h sha1.h sha2.h tiger.c tiger.h
 
 DISTFILES= $(SRCS) AUTHORS COPYING DESCR INSTALL Makefile.in NEWS aclocal.m4 \
 config.guess config.h.in config.sub configure configure.ac install-sh \
@@ -79,6 +79,7 @@
 md5hl.o: digest-types.h
 sha1.o: digest-types.h
 sha1hl.o: digest-types.h
+tiger.o: digest-types.h
 
 clean:
        rm -f *.o digest bits digest-types.h
diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/files/configure
--- a/pkgtools/digest/files/configure   Tue Mar 22 09:58:38 2005 +0000
+++ b/pkgtools/digest/files/configure   Tue Mar 22 10:16:15 2005 +0000
@@ -268,8 +268,8 @@
 # Identity of this package.
 PACKAGE_NAME='nbsd-digest'
 PACKAGE_TARNAME='nbsd-digest'
-PACKAGE_VERSION='20021220'
-PACKAGE_STRING='nbsd-digest 20021220'
+PACKAGE_VERSION='20050310'
+PACKAGE_STRING='nbsd-digest 20050310'
 PACKAGE_BUGREPORT='agc%netbsd.org@localhost'
 
 ac_unique_file="digest.c"
diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/files/configure.ac
--- a/pkgtools/digest/files/configure.ac        Tue Mar 22 09:58:38 2005 +0000
+++ b/pkgtools/digest/files/configure.ac        Tue Mar 22 10:16:15 2005 +0000
@@ -1,7 +1,7 @@
-dnl $Id: configure.ac,v 1.3 2003/07/20 19:55:01 seb Exp $
+dnl $Id: configure.ac,v 1.4 2005/03/22 10:16:15 agc Exp $
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.57)
-AC_INIT([nbsd-digest],[20021220],[agc%netbsd.org@localhost])
+AC_INIT([nbsd-digest],[20050310],[agc%netbsd.org@localhost])
 AC_CONFIG_SRCDIR([digest.c])
 AC_CONFIG_HEADER(config.h)
 AC_ARG_PROGRAM
diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/files/digest.1
--- a/pkgtools/digest/files/digest.1    Tue Mar 22 09:58:38 2005 +0000
+++ b/pkgtools/digest/files/digest.1    Tue Mar 22 10:16:15 2005 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: digest.1,v 1.3 2001/12/03 19:03:22 wiz Exp $
+.\" $NetBSD: digest.1,v 1.4 2005/03/22 10:16:15 agc Exp $
 .\"
 .\"
 .\" Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -72,6 +72,10 @@
 the
 sha512
 algorithm will be used.
+.It tiger
+the
+tiger
+algorithm will be used.
 .El
 .Pp
 The
diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/files/digest.c
--- a/pkgtools/digest/files/digest.c    Tue Mar 22 09:58:38 2005 +0000
+++ b/pkgtools/digest/files/digest.c    Tue Mar 22 10:16:15 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: digest.c,v 1.8 2003/07/24 00:27:09 atatat Exp $ */
+/*     $NetBSD: digest.c,v 1.9 2005/03/22 10:16:15 agc Exp $ */
 
 /*
  * Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -39,7 +39,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2001 \
                The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: digest.c,v 1.8 2003/07/24 00:27:09 atatat Exp $");
+__RCSID("$NetBSD: digest.c,v 1.9 2005/03/22 10:16:15 agc Exp $");
 #endif
 
 
@@ -56,6 +56,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <tiger.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -80,6 +81,7 @@
                SHA256_CTX      sha256;
                SHA384_CTX      sha384;
                SHA512_CTX      sha512;
+               tiger_context_t tiger;
        } hash_ctx, hash_ctx2;
 } alg_t;
 
@@ -103,6 +105,9 @@
        { "SHA512",     SHA512_DIGEST_LENGTH,
          (HASH_init) SHA512_Init,      (HASH_update) SHA512_Update,
          (HASH_end) SHA512_End,        (HASH_file) SHA512_File },
+       { "TIGER",      20,
+         (HASH_init) TIGERInit,        (HASH_update) TIGERUpdate,
+         (HASH_end) TIGEREnd,  (HASH_file) TIGERFile },
        { NULL }
 };
 
diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/files/regress.sh
--- a/pkgtools/digest/files/regress.sh  Tue Mar 22 09:58:38 2005 +0000
+++ b/pkgtools/digest/files/regress.sh  Tue Mar 22 10:16:15 2005 +0000
@@ -1,7 +1,7 @@
 #! /bin/sh
 #
 # From
-# $NetBSD: regress.sh,v 1.2 2002/12/21 04:06:15 schmonz Exp $
+# $NetBSD: regress.sh,v 1.3 2005/03/22 10:16:15 agc Exp $
 
 # one can do, for example to test with openssl: 
 #  DIGESTDIR=/path/to DIGESTCMD=openssl sh regress.sh
@@ -67,6 +67,18 @@
 
 rm -f expected5 output5
 
+cat > expected6 << EOF
+f258c1e88414ab2a527ab541ffc5b8bf935f7b951c132951
+f2589c9ba1f97b0fc30a4fe8f70d61b78ef7537b1e631ca7
+3d9aeb03d1bd1a6357b2774dfd6d5b24dd68151d503974fc
+EOF
+echo $ECHO_N "abc$ECHO_C" | ${DIGEST} tiger > output6
+echo $ECHO_N "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq$ECHO_C" | ${DIGEST} tiger >> output6
+echo $ECHO_N "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge, 1996.$ECHO_C" | ${DIGEST} tiger >> output6
+diff expected6 output6 || echo "*** WARNING: output differs in test 6 (tiger) ***"
+
+rm -f expected6 output6
+
 
 
 exit 0
diff -r e23ca095f12b -r 37e180b45f4a pkgtools/digest/files/tiger.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/digest/files/tiger.c     Tue Mar 22 10:16:15 2005 +0000
@@ -0,0 +1,787 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <digest-types.h>
+
+#include "tiger.h"
+
+/* NOTE that this code is NOT FULLY OPTIMIZED for any  */
+/* machine. Assembly code might be much faster on some */
+/* machines, especially if the code is compiled with   */
+/* gcc.                                                */
+
+/* The number of passes of the hash function.          */
+/* Three passes are recommended.                       */
+/* Use four passes when you need extra security.       */
+/* Must be at least three.                             */
+#define PASSES 3
+
+/* from sboxes.c: Tiger S boxes */
+uint64_t table[4*256] = {
+       0x02AAB17CF7E90C5ELL   /*    0 */,    0xAC424B03E243A8ECLL   /*    1 */,
+       0x72CD5BE30DD5FCD3LL   /*    2 */,    0x6D019B93F6F97F3ALL   /*    3 */,
+       0xCD9978FFD21F9193LL   /*    4 */,    0x7573A1C9708029E2LL   /*    5 */,
+       0xB164326B922A83C3LL   /*    6 */,    0x46883EEE04915870LL   /*    7 */,
+       0xEAACE3057103ECE6LL   /*    8 */,    0xC54169B808A3535CLL   /*    9 */,
+       0x4CE754918DDEC47CLL   /*   10 */,    0x0AA2F4DFDC0DF40CLL   /*   11 */,
+       0x10B76F18A74DBEFALL   /*   12 */,    0xC6CCB6235AD1AB6ALL   /*   13 */,
+       0x13726121572FE2FFLL   /*   14 */,    0x1A488C6F199D921ELL   /*   15 */,
+       0x4BC9F9F4DA0007CALL   /*   16 */,    0x26F5E6F6E85241C7LL   /*   17 */,
+       0x859079DBEA5947B6LL   /*   18 */,    0x4F1885C5C99E8C92LL   /*   19 */,
+       0xD78E761EA96F864BLL   /*   20 */,    0x8E36428C52B5C17DLL   /*   21 */,
+       0x69CF6827373063C1LL   /*   22 */,    0xB607C93D9BB4C56ELL   /*   23 */,
+       0x7D820E760E76B5EALL   /*   24 */,    0x645C9CC6F07FDC42LL   /*   25 */,
+       0xBF38A078243342E0LL   /*   26 */,    0x5F6B343C9D2E7D04LL   /*   27 */,
+       0xF2C28AEB600B0EC6LL   /*   28 */,    0x6C0ED85F7254BCACLL   /*   29 */,
+       0x71592281A4DB4FE5LL   /*   30 */,    0x1967FA69CE0FED9FLL   /*   31 */,
+       0xFD5293F8B96545DBLL   /*   32 */,    0xC879E9D7F2A7600BLL   /*   33 */,
+       0x860248920193194ELL   /*   34 */,    0xA4F9533B2D9CC0B3LL   /*   35 */,
+       0x9053836C15957613LL   /*   36 */,    0xDB6DCF8AFC357BF1LL   /*   37 */,
+       0x18BEEA7A7A370F57LL   /*   38 */,    0x037117CA50B99066LL   /*   39 */,
+       0x6AB30A9774424A35LL   /*   40 */,    0xF4E92F02E325249BLL   /*   41 */,
+       0x7739DB07061CCAE1LL   /*   42 */,    0xD8F3B49CECA42A05LL   /*   43 */,
+       0xBD56BE3F51382F73LL   /*   44 */,    0x45FAED5843B0BB28LL   /*   45 */,
+       0x1C813D5C11BF1F83LL   /*   46 */,    0x8AF0E4B6D75FA169LL   /*   47 */,
+       0x33EE18A487AD9999LL   /*   48 */,    0x3C26E8EAB1C94410LL   /*   49 */,
+       0xB510102BC0A822F9LL   /*   50 */,    0x141EEF310CE6123BLL   /*   51 */,
+       0xFC65B90059DDB154LL   /*   52 */,    0xE0158640C5E0E607LL   /*   53 */,
+       0x884E079826C3A3CFLL   /*   54 */,    0x930D0D9523C535FDLL   /*   55 */,
+       0x35638D754E9A2B00LL   /*   56 */,    0x4085FCCF40469DD5LL   /*   57 */,
+       0xC4B17AD28BE23A4CLL   /*   58 */,    0xCAB2F0FC6A3E6A2ELL   /*   59 */,
+       0x2860971A6B943FCDLL   /*   60 */,    0x3DDE6EE212E30446LL   /*   61 */,
+       0x6222F32AE01765AELL   /*   62 */,    0x5D550BB5478308FELL   /*   63 */,
+       0xA9EFA98DA0EDA22ALL   /*   64 */,    0xC351A71686C40DA7LL   /*   65 */,
+       0x1105586D9C867C84LL   /*   66 */,    0xDCFFEE85FDA22853LL   /*   67 */,
+       0xCCFBD0262C5EEF76LL   /*   68 */,    0xBAF294CB8990D201LL   /*   69 */,
+       0xE69464F52AFAD975LL   /*   70 */,    0x94B013AFDF133E14LL   /*   71 */,
+       0x06A7D1A32823C958LL   /*   72 */,    0x6F95FE5130F61119LL   /*   73 */,
+       0xD92AB34E462C06C0LL   /*   74 */,    0xED7BDE33887C71D2LL   /*   75 */,
+       0x79746D6E6518393ELL   /*   76 */,    0x5BA419385D713329LL   /*   77 */,
+       0x7C1BA6B948A97564LL   /*   78 */,    0x31987C197BFDAC67LL   /*   79 */,
+       0xDE6C23C44B053D02LL   /*   80 */,    0x581C49FED002D64DLL   /*   81 */,
+       0xDD474D6338261571LL   /*   82 */,    0xAA4546C3E473D062LL   /*   83 */,
+       0x928FCE349455F860LL   /*   84 */,    0x48161BBACAAB94D9LL   /*   85 */,
+       0x63912430770E6F68LL   /*   86 */,    0x6EC8A5E602C6641CLL   /*   87 */,
+       0x87282515337DDD2BLL   /*   88 */,    0x2CDA6B42034B701BLL   /*   89 */,
+       0xB03D37C181CB096DLL   /*   90 */,    0xE108438266C71C6FLL   /*   91 */,
+       0x2B3180C7EB51B255LL   /*   92 */,    0xDF92B82F96C08BBCLL   /*   93 */,
+       0x5C68C8C0A632F3BALL   /*   94 */,    0x5504CC861C3D0556LL   /*   95 */,
+       0xABBFA4E55FB26B8FLL   /*   96 */,    0x41848B0AB3BACEB4LL   /*   97 */,
+       0xB334A273AA445D32LL   /*   98 */,    0xBCA696F0A85AD881LL   /*   99 */,
+       0x24F6EC65B528D56CLL   /*  100 */,    0x0CE1512E90F4524ALL   /*  101 */,
+       0x4E9DD79D5506D35ALL   /*  102 */,    0x258905FAC6CE9779LL   /*  103 */,
+       0x2019295B3E109B33LL   /*  104 */,    0xF8A9478B73A054CCLL   /*  105 */,
+       0x2924F2F934417EB0LL   /*  106 */,    0x3993357D536D1BC4LL   /*  107 */,
+       0x38A81AC21DB6FF8BLL   /*  108 */,    0x47C4FBF17D6016BFLL   /*  109 */,
+       0x1E0FAADD7667E3F5LL   /*  110 */,    0x7ABCFF62938BEB96LL   /*  111 */,
+       0xA78DAD948FC179C9LL   /*  112 */,    0x8F1F98B72911E50DLL   /*  113 */,
+       0x61E48EAE27121A91LL   /*  114 */,    0x4D62F7AD31859808LL   /*  115 */,
+       0xECEBA345EF5CEAEBLL   /*  116 */,    0xF5CEB25EBC9684CELL   /*  117 */,
+       0xF633E20CB7F76221LL   /*  118 */,    0xA32CDF06AB8293E4LL   /*  119 */,
+       0x985A202CA5EE2CA4LL   /*  120 */,    0xCF0B8447CC8A8FB1LL   /*  121 */,
+       0x9F765244979859A3LL   /*  122 */,    0xA8D516B1A1240017LL   /*  123 */,
+       0x0BD7BA3EBB5DC726LL   /*  124 */,    0xE54BCA55B86ADB39LL   /*  125 */,
+       0x1D7A3AFD6C478063LL   /*  126 */,    0x519EC608E7669EDDLL   /*  127 */,
+       0x0E5715A2D149AA23LL   /*  128 */,    0x177D4571848FF194LL   /*  129 */,
+       0xEEB55F3241014C22LL   /*  130 */,    0x0F5E5CA13A6E2EC2LL   /*  131 */,
+       0x8029927B75F5C361LL   /*  132 */,    0xAD139FABC3D6E436LL   /*  133 */,
+       0x0D5DF1A94CCF402FLL   /*  134 */,    0x3E8BD948BEA5DFC8LL   /*  135 */,
+       0xA5A0D357BD3FF77ELL   /*  136 */,    0xA2D12E251F74F645LL   /*  137 */,
+       0x66FD9E525E81A082LL   /*  138 */,    0x2E0C90CE7F687A49LL   /*  139 */,
+       0xC2E8BCBEBA973BC5LL   /*  140 */,    0x000001BCE509745FLL   /*  141 */,
+       0x423777BBE6DAB3D6LL   /*  142 */,    0xD1661C7EAEF06EB5LL   /*  143 */,
+       0xA1781F354DAACFD8LL   /*  144 */,    0x2D11284A2B16AFFCLL   /*  145 */,
+       0xF1FC4F67FA891D1FLL   /*  146 */,    0x73ECC25DCB920ADALL   /*  147 */,
+       0xAE610C22C2A12651LL   /*  148 */,    0x96E0A810D356B78ALL   /*  149 */,
+       0x5A9A381F2FE7870FLL   /*  150 */,    0xD5AD62EDE94E5530LL   /*  151 */,
+       0xD225E5E8368D1427LL   /*  152 */,    0x65977B70C7AF4631LL   /*  153 */,
+       0x99F889B2DE39D74FLL   /*  154 */,    0x233F30BF54E1D143LL   /*  155 */,
+       0x9A9675D3D9A63C97LL   /*  156 */,    0x5470554FF334F9A8LL   /*  157 */,
+       0x166ACB744A4F5688LL   /*  158 */,    0x70C74CAAB2E4AEADLL   /*  159 */,
+       0xF0D091646F294D12LL   /*  160 */,    0x57B82A89684031D1LL   /*  161 */,
+       0xEFD95A5A61BE0B6BLL   /*  162 */,    0x2FBD12E969F2F29ALL   /*  163 */,
+       0x9BD37013FEFF9FE8LL   /*  164 */,    0x3F9B0404D6085A06LL   /*  165 */,
+       0x4940C1F3166CFE15LL   /*  166 */,    0x09542C4DCDF3DEFBLL   /*  167 */,
+       0xB4C5218385CD5CE3LL   /*  168 */,    0xC935B7DC4462A641LL   /*  169 */,
+       0x3417F8A68ED3B63FLL   /*  170 */,    0xB80959295B215B40LL   /*  171 */,
+       0xF99CDAEF3B8C8572LL   /*  172 */,    0x018C0614F8FCB95DLL   /*  173 */,
+       0x1B14ACCD1A3ACDF3LL   /*  174 */,    0x84D471F200BB732DLL   /*  175 */,
+       0xC1A3110E95E8DA16LL   /*  176 */,    0x430A7220BF1A82B8LL   /*  177 */,
+       0xB77E090D39DF210ELL   /*  178 */,    0x5EF4BD9F3CD05E9DLL   /*  179 */,
+       0x9D4FF6DA7E57A444LL   /*  180 */,    0xDA1D60E183D4A5F8LL   /*  181 */,
+       0xB287C38417998E47LL   /*  182 */,    0xFE3EDC121BB31886LL   /*  183 */,
+       0xC7FE3CCC980CCBEFLL   /*  184 */,    0xE46FB590189BFD03LL   /*  185 */,
+       0x3732FD469A4C57DCLL   /*  186 */,    0x7EF700A07CF1AD65LL   /*  187 */,
+       0x59C64468A31D8859LL   /*  188 */,    0x762FB0B4D45B61F6LL   /*  189 */,
+       0x155BAED099047718LL   /*  190 */,    0x68755E4C3D50BAA6LL   /*  191 */,



Home | Main Index | Thread Index | Old Index