]>
git.saurik.com Git - apple/security.git/blob - SecureTransport/privateInc/st_sha.h
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
22 /* NIST Secure Hash Algorithm */
23 /* heavily modified from Peter C. Gutmann's implementation */
25 /* Useful defines & typedefs */
27 /* Possibly an unreasonable assumption, but it works */
29 #define LITTLE_ENDIAN 1
32 typedef unsigned char BYTE
;
33 typedef unsigned long LONG
;
35 #define SHA_BLOCKSIZE 64
36 #define SHA_DIGESTSIZE 20
39 LONG digest
[5]; /* message digest */
40 LONG count_lo
, count_hi
; /* 64-bit bit count */
41 LONG data
[16]; /* SHA data buffer */
44 void sha_init(SHA_INFO
*);
45 void sha_update(SHA_INFO
*, BYTE
*, int);
46 void sha_final(SHA_INFO
*);
48 void sha_stream(SHA_INFO
*, FILE *);
49 void sha_print(SHA_INFO
*);
51 #define USE_MODIFIED_SHA 1