]>
git.saurik.com Git - apple/security.git/blob - Security/libsecurity_cryptkit/lib/ECDSA_Profile.h
4 Contains: ECDSA Profiling support.
7 Copyright: Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
9 Change History (most recent first):
11 <7> 10/06/98 ap Changed to compile with C++.
16 /* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
18 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
19 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
20 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE
21 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
22 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
23 * EXPOSE YOU TO LIABILITY.
24 ***************************************************************************
27 #ifndef _CK_ECDSA_PROFILE_H_
28 #define _CK_ECDSA_PROFILE_H_
32 #if CRYPTKIT_ECDSA_ENABLE
37 #define ECDSA_PROFILE 0
39 #define ECDSA_PROFILE 0 /* always off */
40 #endif /* FEE_DEBUG */
44 #include <kern/time_stamp.h>
47 * Unlike the profiling macros in feeDebug.h, these are intended to
48 * be used for fragments of code, not entire functions.
50 #define SIGPROF_START \
52 struct tsval _profStartTime; \
53 struct tsval _profEndTime; \
54 kern_timestamp(&_profStartTime);
57 * This one goes at the end of the routine, just before the (only) return.
58 * There must be a static accumulator (an unsigned int) on a per-routine basis.
60 #define SIGPROF_END(accum) \
61 kern_timestamp(&_profEndTime); \
62 accum += (_profEndTime.low_val - _profStartTime.low_val); \
69 extern unsigned signStep1
;
70 extern unsigned signStep2
;
71 extern unsigned signStep34
;
72 extern unsigned signStep5
;
73 extern unsigned signStep67
;
74 extern unsigned signStep8
;
75 extern unsigned vfyStep1
;
76 extern unsigned vfyStep3
;
77 extern unsigned vfyStep4
;
78 extern unsigned vfyStep5
;
79 extern unsigned vfyStep6
;
80 extern unsigned vfyStep7
;
82 #else /* ECDSA_PROFILE */
85 #define SIGPROF_END(accum)
87 #endif /* ECDSA_PROFILE */
89 #endif /* CRYPTKIT_ECDSA_ENABLE */
90 #endif /* _CK_ECDSA_PROFILE_H_ */