mbed TLS v2.6.0
timing.h
Go to the documentation of this file.
1 
25 #ifndef MBEDTLS_TIMING_H
26 #define MBEDTLS_TIMING_H
27 
28 #if !defined(MBEDTLS_CONFIG_FILE)
29 #include "config.h"
30 #else
31 #include MBEDTLS_CONFIG_FILE
32 #endif
33 
34 #if !defined(MBEDTLS_TIMING_ALT)
35 // Regular implementation
36 //
37 
38 #include <stdint.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
48 {
49  unsigned char opaque[32];
50 };
51 
55 typedef struct
56 {
57  struct mbedtls_timing_hr_time timer;
58  uint32_t int_ms;
59  uint32_t fin_ms;
61 
62 extern volatile int mbedtls_timing_alarmed;
63 
71 unsigned long mbedtls_timing_hardclock( void );
72 
79 unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset );
80 
90 void mbedtls_set_alarm( int seconds );
91 
102 void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms );
103 
116 int mbedtls_timing_get_delay( void *data );
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #else /* MBEDTLS_TIMING_ALT */
123 #include "timing_alt.h"
124 #endif /* MBEDTLS_TIMING_ALT */
125 
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
129 
130 #if defined(MBEDTLS_SELF_TEST)
131 
136 int mbedtls_timing_self_test( int verbose );
137 #endif
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* timing.h */
unsigned long mbedtls_timing_hardclock(void)
Return the CPU cycle counter value.
unsigned char opaque[32]
Definition: timing.h:49
Configuration options (set of defines)
void mbedtls_timing_set_delay(void *data, uint32_t int_ms, uint32_t fin_ms)
Set a pair of delays to watch (See mbedtls_timing_get_delay().)
Context for mbedtls_timing_set/get_delay()
Definition: timing.h:55
volatile int mbedtls_timing_alarmed
void mbedtls_set_alarm(int seconds)
Setup an alarm clock.
int mbedtls_timing_self_test(int verbose)
Checkup routine.
unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset)
Return the elapsed time in milliseconds.
timer structure
Definition: timing.h:47
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.)