]>
git.saurik.com Git - apple/security.git/blob - libsecurity_cryptkit/lib/feeECDSA.h
1 /* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
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 COMPUTER, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE COMPUTER,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
11 * feeECDSA.h - Elliptic Curve Digital Signature Algorithm (per IEEE 1363)
15 * 16 Jul 97 Doug Mitchell at Apple
19 #ifndef _CK_FEEECDSA_H_
20 #define _CK_FEEECDSA_H_
22 #if !defined(__MACH__)
25 #include <feePublicKey.h>
27 #include <security_cryptkit/ckconfig.h>
28 #include <security_cryptkit/feeTypes.h>
29 #include <security_cryptkit/feePublicKey.h>
33 * Keep this one defined and visible even if we can't actually do ECDSA - feeSigParse()
34 * uses it to detect "wriong signature type".
36 #define FEE_ECDSA_MAGIC 0xfee00517
38 #if CRYPTKIT_ECDSA_ENABLE
46 * Sign specified block of data (most likely a hash result) using
47 * specified private key. Result, an enc64-encoded signature block,
48 * is returned in *sigData.
50 feeReturn
feeECDSASign(feePubKey pubKey
,
51 const unsigned char *data
, // data to be signed
52 unsigned dataLen
, // in bytes
53 feeRandFcn randFcn
, // optional
54 void *randRef
, // optional
55 unsigned char **sigData
, // malloc'd and RETURNED
56 unsigned *sigDataLen
); // RETURNED
59 * Verify signature, obtained via feeECDSASign, for specified
60 * data (most likely a hash result) and feePubKey. Returns FR_Success or
61 * FR_InvalidSignature.
63 feeReturn
feeECDSAVerify(const unsigned char *sigData
,
65 const unsigned char *data
,
70 * For given key, calculate maximum signature size.
72 feeReturn
feeECDSASigSize(
80 #endif /* CRYPTKIT_ECDSA_ENABLE */
82 #endif /*_CK_FEEECDSA_H_*/