12673N/AFor the avoidance of doubt, except that if any license choice other
12673N/Athan GPL or LGPL is available it will apply instead, Sun elects to
12673N/Ause only the General Public License version 2 (GPLv2) at this time
12673N/Afor any software where a choice of GPL license versions is made
12673N/Aavailable with the language indicating that GPLv2 or any later
12673N/Aversion may be used, or where a choice of which version of the GPL
12673N/Ais applied is otherwise unspecified.
12673N/A--------------------------------------------------------------------
12673N/A Note: I added some stuff for use with gnupg
12673N/ACopyright (C) 1991, 1992, 1993, 1994, 1996, 1998,
12673N/A 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
12673N/AThis file is free software; you can redistribute it
and/or modify
12673N/Ait under the terms of the GNU Lesser General Public License as published by
12673N/Athe Free Software Foundation; either version 2.1 of the License, or (at your
12673N/AThis file is distributed in the hope that it will be useful, but
12673N/AWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12673N/Aor FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12673N/AYou should have received a copy of the GNU Library General Public License
12673N/Athe Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
12673N/A You have to define the following before including this file:
12673N/A UWtype -- An unsigned type, default type for operations (typically a "word")
12673N/A UHWtype -- An unsigned type, at least half the size of UWtype.
12673N/A UDWtype -- An unsigned type, at least twice as large a UWtype
12673N/A W_TYPE_SIZE -- size in bits of UWtype
12673N/A SItype, USItype -- Signed and unsigned 32 bit types.
12673N/A DItype, UDItype -- Signed and unsigned 64 bit types.
12673N/A On a 32 bit machine UWtype should typically be USItype;
12673N/A on a 64 bit machine, UWtype should typically be UDItype.
12673N/A--------------------------------------------------------------------
12673N/A Run this to generate all the initial makefiles, etc.
12673N/A Copyright (C) 2003, 2004 g10 Code GmbH
12673N/A This file is free software; as a special exception the author gives
12673N/A unlimited permission to copy
and/or distribute it, with or without
12673N/A modifications, as long as this notice is preserved.
12673N/A This program is distributed in the hope that it will be useful, but
12673N/A WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
12673N/A implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12673N/A--------------------------------------------------------------------
12673N/A Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
12673N/A Copyright (C) 2005 Free Software Foundation, Inc.
12673N/A This program is free software; you can redistribute it
and/or 12673N/A modify it under the terms of the GNU General Public License as
12673N/A published by the Free Software Foundation; either version 2 of the
12673N/A License, or (at your option) any later version.
12673N/A This program is distributed in the hope that it will be useful, but
12673N/A WITHOUT ANY WARRANTY; without even the implied warranty of
12673N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12673N/A General Public License for more details.
12673N/A You should have received a copy of the GNU General Public License
12673N/A along with this program; if not, write to the Free Software
12673N/A Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
12673N/A--------------------------------------------------------------------
12673N/A Copyright (C) 2002, 2003, 2004 g10 Code GmbH
12673N/A This file is part of Libgcrypt.
12673N/A Libgcrypt is free software; you can redistribute it
and/or modify
12673N/A it under the terms of the GNU Lesser General Public License as
12673N/A published by the Free Software Foundation; either version 2.1 of
12673N/A the License, or (at your option) any later version.
12673N/A Libgcrypt is distributed in the hope that it will be useful, but
12673N/A WITHOUT ANY WARRANTY; without even the implied warranty of
12673N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12673N/A General Public License for more details.
12673N/A You should have received a copy of the GNU Lesser General Public
12673N/A License along with Libgcrypt; if not, write to the Free Software
12673N/A Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
12673N/A--------------------------------------------------------------------
12673N/A Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
12673N/A Copyright Peter Gutmann, Matt Thomlinson and Blake Coverett 1996-1999
12673N/A Copyright Peter Gutmann, Paul Kendall, and Chris Wedgwood 1996-1999. *
12673N/A***************************************************************************
12673N/A Unix Randomness-Gathering Code *
12673N/A Heavily modified for GnuPG by Werner Koch *
12673N/A ***************************************************************************
12673N/A This module is part of the cryptlib continuously seeded pseudorandom
12673N/A This file is part of Libgcrypt.
12673N/A************************************************************************
12673N/A The code here is based on code from Cryptlib 3.0 beta by Peter Gutmann.
12673N/A This module is part of the cryptlib continuously seeded pseudorandom
12673N/A continuously seeded pseudorandom number generator (CSPRNG) as described in
12673N/A my 1998 Usenix Security Symposium paper "The generation of random numbers
12673N/A The CSPRNG code is copyright Peter Gutmann (and various others) 1996,
12673N/A 1997, 1998, 1999, all rights reserved. Redistribution of the CSPRNG
12673N/A modules and use in source and binary forms, with or without modification,
12673N/A are permitted provided that the following conditions are met:
12673N/A 1. Redistributions of source code must retain the above copyright notice
12673N/A and this permission notice in its entirety.
12673N/A 2. Redistributions in binary form must reproduce the copyright notice in
12673N/A the documentation
and/or other materials provided with the distribution.
12673N/A 3. A copy of any bugfixes or enhancements made must be provided to the
12673N/A author, <pgut001@cs.auckland.ac.nz> to allow them to be added to the
12673N/A ALTERNATIVELY, the code may be distributed under the terms of the GNU
12673N/A General Public License, version 2 or any later version published by the
12673N/A Free Software Foundation, in which case the provisions of the GNU GPL are
12673N/A required INSTEAD OF the above restrictions.
12673N/A Although not required under the terms of the GPL, it would still be nice if
12673N/A you could make any changes available to the author to allow a consistent
12673N/A Fixme: We use plain mallocs here beucase it may be used as a module
12673N/A************************************************************************
12673N/A--------------------------------------------------------------------
12673N/A Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
12673N/A This file is part of the GNU C Library.
12673N/A The GNU C Library is free software; you can redistribute it
and/or 12673N/A modify it under the terms of the GNU Library General Public License as
12673N/A published by the Free Software Foundation; either version 2 of the
12673N/A License, or (at your option) any later version.
12673N/A The GNU C Library is distributed in the hope that it will be useful,
12673N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
12673N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12673N/A Library General Public License for more details.
12673N/A You should have received a copy of the GNU Library General Public
12673N/A write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
12673N/A--------------------------------------------------------------------
12673N/A Copyright (C) 1997, 1998, 1999 by Werner Koch (dd9jn)
12673N/A Copyright (C) 1992, 1994-2006 Free Software Foundation, Inc.
12673N/A Copyright (C) 2003 Nikos Mavroyanopoulos
12673N/A 2000, 2002 Free Software Foundation, Inc.
12673N/A 2003 Free Software Foundation, Inc.
12673N/A 2003 Free Software Foundation, Inc.
12673N/A 2001, 2002 Free Software Foundation, Inc.
12673N/A 2004, 2005 Free Software Foundation, Inc.
12673N/A 2004, 2006 Free Software Foundation, Inc.
12673N/A 2001, 2002 Free Software Foundation, Inc.
12673N/A This file is part of Libgcrypt.
12673N/A 2002 Free Software Foundation, Inc.
12673N/A mpih-w-sdiv -- implement udiv_qrnnd on machines with only signed
12673N/A Contributed by Peter L. Montgomery.
12673N/A ac.c - Alternative interface for asymmetric cryptography.
12673N/A 2002 Free Software Foundation, Inc.
12673N/A 2002 Free Software Foundation, Inc.
12673N/A 2003 Free Software Foundation, Inc.
12673N/A 2004 Free Software Foundation, Inc.
12673N/A 2002 Free Software Foundation, Inc.
12673N/A Please see below for more legal information!
12673N/A 2004 Free Software Foundation, Inc.
12673N/A 2004, 2005, 2006 Free Software Foundation, Inc.
12673N/A 2003 Free Software Foundation, Inc.
12673N/A Written by Matthew Skala <mskala@ansuz.sooke.bc.ca>, July 26, 1998
12673N/A 256-bit key length added March 20, 1999
12673N/A Some modifications to reduce the text size by Werner Koch, April, 1998
12673N/A This way we can better distinguish between internal and external
12673N/A 2001, 2002 Free Software Foundation, Inc.
12673N/A 2003 Free Software Foundation, Inc.
12673N/A 2001, 2002 Free Software Foundation, Inc.
12673N/A 2001, 2002 Free Software Foundation, Inc.
12673N/A 2003 Free Software Foundation, Inc.
12673N/A 2000, 2001, 2002 Free Software Foundation, Inc.
12673N/A 2003 Free Software Foundation, Inc.
12673N/A This file is part of Libgcrypt.
12673N/A Libgcrypt is free software; you can redistribute it
and/or modify
12673N/A it under the terms of the GNU Lesser general Public License as
12673N/A published by the Free Software Foundation; either version 2.1 of
12673N/A the License, or (at your option) any later version.
12673N/A Libgcrypt is distributed in the hope that it will be useful,
12673N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
12673N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12673N/A GNU Lesser General Public License for more details.
12673N/A You should have received a copy of the GNU Lesser General Public
12673N/A License along with this program; if not, write to the Free Software
12673N/A Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
12673N/A Based on
md5.c in libgcrypt, but rewritten to compute md4 checksums
12673N/A using a public domain md4 implementation with the following comments:
12673N/A The original code and all modifications are in the public domain.
12673N/A This is the original introductory comment:
12673N/A Part of the Python Cryptography Toolkit, version 1.1
12673N/A Distribute and use freely; there are no restrictions on further
12673N/A dissemination and usage except those imposed by the laws of your
12673N/A MD4 ("") = 31d6cfe0d16ae931b73c59d7e0c089c0
12673N/A MD4 ("a") = bde52cb31de33e46245e05fbdbd6fb24
12673N/A MD4 ("abc") = a448017aaf21d8525fc10ae87aa6729d
12673N/A MD4 ("message digest") = d9130a8164549fe818874806e1c7014b
12673N/A MD4 ("abcdefghijklmnopqrstuvwxyz") = d79e1c308aa5bbcdeea8ed63df412da9
12673N/A MD4 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =
12673N/A 043f8582f241db351ce627e153e7f0e4
12673N/A MD4 ("123456789012345678901234567890123456789012345678901234567890123456
12673N/A 78901234567890") = e33b4ddc9c38f2199c3e7b164fcc0536
12673N/A For a description of the algorithm, see:
12673N/A Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
12673N/A ISBN 0-471-11709-9. Pages 397 ff.
12673N/A Note: This code is heavily based on the GNU MP Library.
12673N/A Actually it's the same code with only minor changes in the
12673N/A way the data is stored; this is to support the abstraction
12673N/A of an optional secure memory allocation which may be used
12673N/A to avoid revealing of sensitive data due to paging etc.
12673N/A Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
12673N/A ISBN 0-471-11709-9. Pages 476 ff.
12673N/A This random number generator is modelled after the one described in
12673N/A Peter Gutmann's paper: "Software Generation of Practically Strong
12673N/A Random Numbers". See also chapter 6 in his book "Cryptographic
12673N/A Security Architecture", New York, 2004, ISBN 0-387-95387-6.
12673N/A Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
12673N/A This implementation was written by Nikos Mavroyanopoulos for GNUTLS
12673N/A direct use by Libgcrypt by Werner Koch. This implementation is
12673N/A only useful for pkcs#12 descryption.
12673N/A The implementation here is based on Peter Gutmann's RRC.2 paper.
12673N/A This code uses an algorithm protected by
U.S. Patent #4,405,829
12673N/A which expired on September 20, 2000. The patent holder placed that
12673N/A patent into the public domain on Sep 6th, 2000.
12673N/A Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
12673N/A A999 3E36 4706 816A BA3E 2571 7850 C26C 9CD0 D89D
12673N/A "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
12673N/A 8498 3E44 1C3B D26E BAAE 4AA1 F951 29E5 E546 70F1
12673N/A 128-bit key = 01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A
12673N/A plaintext = 01 23 45 67 89 AB CD EF
12673N/A ciphertext = 23 8B 4F E5 84 7E 44 B2
12673N/A 80-bit key = 01 23 45 67 12 34 56 78 23 45
12673N/A = 01 23 45 67 12 34 56 78 23 45 00 00 00 00 00 00
12673N/A plaintext = 01 23 45 67 89 AB CD EF
12673N/A ciphertext = EB 6A 71 1A 2C 02 27 1B
12673N/A = 01 23 45 67 12 00 00 00 00 00 00 00 00 00 00 00
12673N/A plaintext = 01 23 45 67 89 AB CD EF
12673N/A ciphertext = 7A C8 16 D1 6E 9B 30 2E
12673N/A ***********************************************************************
12673N/A The algorithm used to generate practically save primes is due to
12673N/A Lim and Lee as described in the CRYPTO '97 proceedings (ISBN3540633847)
12673N/A You should have received a copy of the GNU General Public License
12673N/A along with this program; if not, write to the Free Software
12673N/A Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
12673N/A CB00753F 45A35E8B B5A03D69 9AC65007 272C32AB 0EDED163
12673N/A 1A8B605A 43FF5BED 8086072B A1E7CC23 58BAECA1 34C825A7
12673N/A DDAF35A1 93617ABA CC417349 AE204131 12E6FA4E 89A97EA2 0A9EEEE6 4B55D39A
12673N/A 2192992A 274FC1A8 36BA3C23 A3FEEBBD 454D4423 643CE80E 2A9AC94F A54CA49F
12673N/A "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
12673N/A 09330C33 F71147E8 3D192FC7 82CD1B47 53111B17 3B3B05D2
12673N/A 2FA08086 E3B0F712 FCC7C71A 557E2DB9 66C3E9FA 91746039
12673N/A 8E959B75 DAE313DA 8CF4F728 14FC143F 8F7779C6 EB9F7FA1 7299AEAD B6889018
12673N/A 501D289E 4900F7E4 331B99DE C4B5433A C7D329EE B6DD2654 5E96E55B 874BE909
12673N/A 9D0E1809 716474CB 086E834E 310A4A1C ED149E9C 00F24852
12673N/A 7972CEC5 704C2A5B 07B8B3DC 38ECC4EB AE97DDD8 7F3D8985
12673N/A E718483D 0CE76964 4E2E42C7 BC15B463 8E1F98B1 3B204428 5632A803 AFA973EB
12673N/A DE0FF244 877EA60A 4CB0432C E577C31B EB009C5C 2C49AA2E 4EADB217 AD8CC09B
12673N/A ISBN 0-471-11709-9. Pages 336 ff.
12673N/A key "abcdefghijklmnopqrstuvwxyz";
12673N/A******************************************************************
12673N/A The code here is based on the optimized implementation taken from
12673N/A------------------------------------------
12673N/A authors: v1.0: Antoon Bosselaers
12673N/A This code is placed in the public domain.
12673N/A------------------------------------------