~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysys/sha1.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2002, 2004, 2006 MySQL AB
 
1
/* Copyright (c) 2002, 2004, 2006 MySQL AB
2
2
 
3
3
 This program is free software; you can redistribute it and/or modify
4
4
 it under the terms of the GNU General Public License as published by
6
6
 
7
7
 This program is distributed in the hope that it will be useful,
8
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
10
 GNU General Public License for more details.
11
11
 
12
12
 You should have received a copy of the GNU General Public License
13
13
 along with this program; if not, write to the Free Software
14
 
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
14
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
*/
15
16
 
16
17
/*
17
18
  Original Source from: http://www.faqs.org/rfcs/rfc3174.html
18
19
 
 
20
  Copyright (C) The Internet Society (2001).  All Rights Reserved.
 
21
 
 
22
  This document and translations of it may be copied and furnished to
 
23
  others, and derivative works that comment on or otherwise explain it
 
24
  or assist in its implementation may be prepared, copied, published
 
25
  and distributed, in whole or in part, without restriction of any
 
26
  kind, provided that the above copyright notice and this paragraph are
 
27
  included on all such copies and derivative works.  However, this
 
28
  document itself may not be modified in any way, such as by removing
 
29
  the copyright notice or references to the Internet Society or other
 
30
  Internet organizations, except as needed for the purpose of
 
31
  developing Internet standards in which case the procedures for
 
32
  copyrights defined in the Internet Standards process must be
 
33
  followed, or as required to translate it into languages other than
 
34
  English.
 
35
 
 
36
  The limited permissions granted above are perpetual and will not be
 
37
  revoked by the Internet Society or its successors or assigns.
 
38
 
 
39
  This document and the information contained herein is provided on an
 
40
  "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
 
41
  TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
 
42
  BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
 
43
  HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
 
44
  MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 
45
 
 
46
  Acknowledgement 
 
47
  Funding for the RFC Editor function is currently provided by the 
 
48
  Internet Society. 
 
49
 
19
50
 DESCRIPTION
20
 
   This file implements the Secure Hashing Algorithm 1 as
21
 
   defined in FIPS PUB 180-1 published April 17, 1995.
 
51
  This file implements the Secure Hashing Algorithm 1 as
 
52
  defined in FIPS PUB 180-1 published April 17, 1995.
22
53
 
23
 
   The SHA-1, produces a 160-bit message digest for a given data
24
 
   stream.  It should take about 2**n steps to find a message with the
25
 
   same digest as a given message and 2**(n/2) to find any two
26
 
   messages with the same digest, when n is the digest size in bits.
27
 
   Therefore, this algorithm can serve as a means of providing a
28
 
   "fingerprint" for a message.
 
54
  The SHA-1, produces a 160-bit message digest for a given data
 
55
  stream.  It should take about 2**n steps to find a message with the
 
56
  same digest as a given message and 2**(n/2) to find any two
 
57
  messages with the same digest, when n is the digest size in bits.
 
58
  Therefore, this algorithm can serve as a means of providing a
 
59
  "fingerprint" for a message.
29
60
 
30
61
 PORTABILITY ISSUES
31
62
   SHA-1 is defined in terms of 32-bit "words".  This code uses