]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cryptkit/lib/ckSHA1_priv.h
Security-58286.41.2.tar.gz
[apple/security.git] / OSX / libsecurity_cryptkit / lib / ckSHA1_priv.h
1 /* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
2 *
3 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
4 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
5 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
10 *
11 * ckSHA1_priv.h - private low-level API for SHA-1 hash algorithm
12 *
13 * Revision History
14 * ----------------
15 * 22 Aug 96 at NeXT
16 * Created.
17 */
18
19 /* Useful defines/typedefs */
20
21 #ifndef _CK_SHA1_PRIV_H_
22 #define _CK_SHA1_PRIV_H_
23
24 #include "ckconfig.h"
25
26 #if !CRYPTKIT_LIBMD_DIGEST
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 typedef unsigned char BYTE;
33 typedef unsigned long LONG;
34
35 /* The SHS block size and message digest sizes, in bytes */
36
37 #define SHS_BLOCKSIZE 64
38 #define SHS_DIGESTSIZE 20
39
40 /* The structure for storing SHS info */
41
42 typedef struct {
43 LONG digest[ 5 ]; /* Message digest */
44 LONG countLo, countHi; /* 64-bit bit count */
45 LONG data[ 80 ]; /* SHS data buffer */
46 } SHS_INFO;
47
48 extern void shsInit(SHS_INFO *shsInfo);
49 extern void shsUpdate(SHS_INFO *shsInfo,
50 const BYTE *buffer,
51 int count);
52 extern void shsFinal(SHS_INFO *shsInfo);
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif /* !CRYPTKIT_LIBMD_DIGEST */
59
60 #endif /* _CK_SHA1_PRIV_H_ */