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.
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
17
18
Original Source from: http://www.faqs.org/rfcs/rfc3174.html
20
Copyright (C) The Internet Society (2001). All Rights Reserved.
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
36
The limited permissions granted above are perpetual and will not be
37
revoked by the Internet Society or its successors or assigns.
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.
47
Funding for the RFC Editor function is currently provided by the
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.
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.
31
62
SHA-1 is defined in terms of 32-bit "words". This code uses