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.h - generic, portable SHA-1 hash object
12 *
13 * Revision History
14 * ----------------
15 * 05 Jan 1998 at Apple
16 *	Created.
17 */
18
19#ifndef	_CK_SHA1_H_
20#define _CK_SHA1_H_
21
22#if	!defined(__MACH__)
23#include <feeTypes.h>
24#else
25#include <security_cryptkit/feeTypes.h>
26#endif
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/*
33 * Opaque sha1 object handle.
34 */
35typedef void *sha1Obj;
36
37/*
38 * Alloc and init an empty sha1 object.
39 */
40sha1Obj sha1Alloc(void);
41
42/*
43 * reinitialize an sha1 object for reuse.
44 */
45void sha1Reinit(sha1Obj sha1);
46
47/*
48 * Free an sha1 object.
49 */
50void sha1Free(sha1Obj sha1);
51
52/*
53 * Add some data to the sha1 object.
54 */
55void sha1AddData(sha1Obj sha1,
56	const unsigned char *data,
57	unsigned dataLen);
58
59/*
60 * Obtain a pointer to completed message digest. This disables further calls
61 * to sha1AddData(). This pointer is NOT malloc'd; the associated data
62 * persists only as long as this object does.
63 */
64unsigned char *sha1Digest(sha1Obj sha1);
65
66/*
67 * Obtain the length of the message digest.
68 */
69unsigned sha1DigestLen(void);
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif	/*_CK_SHA1_H_*/
76