mbed TLS v2.0.0
timing.h
Go to the documentation of this file.
1 
24 #ifndef MBEDTLS_TIMING_H
25 #define MBEDTLS_TIMING_H
26 
27 #if !defined(MBEDTLS_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include MBEDTLS_CONFIG_FILE
31 #endif
32 
33 #if !defined(MBEDTLS_TIMING_ALT)
34 // Regular implementation
35 //
36 
37 #include <stdint.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
47 {
48  unsigned char opaque[32];
49 };
50 
54 typedef struct
55 {
56  struct mbedtls_timing_hr_time timer;
57  uint32_t int_ms;
58  uint32_t fin_ms;
60 
61 extern volatile int mbedtls_timing_alarmed;
62 
70 unsigned long mbedtls_timing_hardclock( void );
71 
78 unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset );
79 
89 void mbedtls_set_alarm( int seconds );
90 
101 void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms );
102 
115 int mbedtls_timing_get_delay( void *data );
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #else /* MBEDTLS_TIMING_ALT */
122 #include "timing_alt.h"
123 #endif /* MBEDTLS_TIMING_ALT */
124 
125 #ifdef __cplusplus
126 extern "C" {
127 #endif
128 
129 #if defined(MBEDTLS_SELF_TEST)
130 
135 int mbedtls_timing_self_test( int verbose );
136 #endif
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* timing.h */
unsigned long mbedtls_timing_hardclock(void)
Return the CPU cycle counter value.
unsigned char opaque[32]
Definition: timing.h:48
Compatibility names (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:54
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:46
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.)