]>
git.saurik.com Git - apple/security.git/blob - libsecurity_cryptkit/lib/ECDSA_Profile.h
4 Contains: ECDSA Profiling support.
6 Written by: Doug Mitchell
8 Copyright: Copyright 1998 by Apple Computer, Inc., all rights reserved.
10 Change History (most recent first):
12 <7> 10/06/98 ap Changed to compile with C++.
17 /* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
19 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
20 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
21 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE COMPUTER, INC. AND THE
22 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE COMPUTER,
23 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
24 * EXPOSE YOU TO LIABILITY.
25 ***************************************************************************
28 #ifndef _CK_ECDSA_PROFILE_H_
29 #define _CK_ECDSA_PROFILE_H_
33 #if CRYPTKIT_ECDSA_ENABLE
38 #define ECDSA_PROFILE 0
40 #define ECDSA_PROFILE 0 /* always off */
41 #endif /* FEE_DEBUG */
45 #include <kern/time_stamp.h>
48 * Unlike the profiling macros in feeDebug.h, these are intended to
49 * be used for fragments of code, not entire functions.
51 #define SIGPROF_START \
53 struct tsval _profStartTime; \
54 struct tsval _profEndTime; \
55 kern_timestamp(&_profStartTime);
58 * This one goes at the end of the routine, just before the (only) return.
59 * There must be a static accumulator (an unsigned int) on a per-routine basis.
61 #define SIGPROF_END(accum) \
62 kern_timestamp(&_profEndTime); \
63 accum += (_profEndTime.low_val - _profStartTime.low_val); \
70 extern unsigned signStep1
;
71 extern unsigned signStep2
;
72 extern unsigned signStep34
;
73 extern unsigned signStep5
;
74 extern unsigned signStep67
;
75 extern unsigned signStep8
;
76 extern unsigned vfyStep1
;
77 extern unsigned vfyStep3
;
78 extern unsigned vfyStep4
;
79 extern unsigned vfyStep5
;
80 extern unsigned vfyStep6
;
81 extern unsigned vfyStep7
;
83 #else /* ECDSA_PROFILE */
86 #define SIGPROF_END(accum)
88 #endif /* ECDSA_PROFILE */
90 #endif /* CRYPTKIT_ECDSA_ENABLE */
91 #endif /* _CK_ECDSA_PROFILE_H_ */