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 * CipherFileFEED.h - FEED and FEEDExp related cipherfile support
12 *
13 * Revision History
14 * ----------------
15 * 18 Feb 97 at Apple
16 *	Created.
17 */
18
19#ifndef	_CK_CFILEFEED_H_
20#define _CK_CFILEFEED_H_
21
22#include "ckconfig.h"
23
24#if CRYPTKIT_CIPHERFILE_ENABLE
25
26#include "Crypt.h"
27#include "feeCipherFile.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/*
34 * Private functions.
35 */
36feeReturn createFEED(feePubKey sendPrivKey,
37	feePubKey recvPubKey,
38	const unsigned char *plainText,
39	unsigned plainTextLen,
40	int genSig,				// 1 ==> generate signature
41	unsigned userData,			// for caller's convenience
42	feeCipherFile *cipherFile);		// RETURNED if successful
43feeReturn decryptFEED(feeCipherFile cipherFile,
44	feePubKey recvPrivKey,
45	feePubKey sendPubKey,
46	unsigned char **plainText,		// RETURNED
47	unsigned *plainTextLen,			// RETURNED
48	feeSigStatus *sigStatus);		// RETURNED
49feeReturn createFEEDExp(feePubKey sendPrivKey,
50	feePubKey recvPubKey,
51	const unsigned char *plainText,
52	unsigned plainTextLen,
53	int genSig,				// 1 ==> generate signature
54	unsigned userData,			// for caller's convenience
55	feeCipherFile *cipherFile);		// RETURNED if successful
56feeReturn decryptFEEDExp(feeCipherFile cipherFile,
57	feePubKey recvPrivKey,
58	feePubKey sendPubKey,			// optional
59	unsigned char **plainText,		// RETURNED
60	unsigned *plainTextLen,			// RETURNED
61	feeSigStatus *sigStatus);		// RETURNED
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif	/* CRYPTKIT_CIPHERFILE_ENABLE */
68
69#endif	/*_CK_CFILEFEED_H_*/
70