Mbed TLS v2.28.10
Loading...
Searching...
No Matches
include
mbedtls
timing.h
Go to the documentation of this file.
1
6
/*
7
* Copyright The Mbed TLS Contributors
8
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9
*/
10
#ifndef MBEDTLS_TIMING_H
11
#define MBEDTLS_TIMING_H
12
13
#if !defined(MBEDTLS_CONFIG_FILE)
14
#include "
mbedtls/config.h
"
15
#else
16
#include MBEDTLS_CONFIG_FILE
17
#endif
18
19
#include <stdint.h>
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
#if !defined(MBEDTLS_TIMING_ALT)
26
// Regular implementation
27
//
28
32
struct
mbedtls_timing_hr_time
{
33
unsigned
char
opaque
[32];
34
};
35
39
typedef
struct
mbedtls_timing_delay_context
{
40
struct
mbedtls_timing_hr_time
timer
;
41
uint32_t
int_ms
;
42
uint32_t
fin_ms
;
43
}
mbedtls_timing_delay_context
;
44
45
#else
/* MBEDTLS_TIMING_ALT */
46
#include "timing_alt.h"
47
#endif
/* MBEDTLS_TIMING_ALT */
48
49
extern
volatile
int
mbedtls_timing_alarmed
;
50
61
unsigned
long
mbedtls_timing_hardclock
(
void
);
62
80
unsigned
long
mbedtls_timing_get_timer
(
struct
mbedtls_timing_hr_time
*val,
int
reset);
81
92
void
mbedtls_set_alarm
(
int
seconds);
93
108
void
mbedtls_timing_set_delay
(
void
*data, uint32_t int_ms, uint32_t fin_ms);
109
122
int
mbedtls_timing_get_delay
(
void
*data);
123
124
#if defined(MBEDTLS_SELF_TEST)
130
int
mbedtls_timing_self_test
(
int
verbose);
131
#endif
132
133
#ifdef __cplusplus
134
}
135
#endif
136
137
#endif
/* timing.h */
config.h
Configuration options (set of defines)
mbedtls_timing_delay_context
Context for mbedtls_timing_set/get_delay()
Definition
timing.h:39
mbedtls_timing_delay_context::int_ms
uint32_t int_ms
Definition
timing.h:41
mbedtls_timing_delay_context::timer
struct mbedtls_timing_hr_time timer
Definition
timing.h:40
mbedtls_timing_delay_context::fin_ms
uint32_t fin_ms
Definition
timing.h:42
mbedtls_timing_hr_time
timer structure
Definition
timing.h:32
mbedtls_timing_hr_time::opaque
unsigned char opaque[32]
Definition
timing.h:33
mbedtls_timing_get_timer
unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset)
Return the elapsed time in milliseconds.
mbedtls_set_alarm
void mbedtls_set_alarm(int seconds)
Setup an alarm clock.
mbedtls_timing_self_test
int mbedtls_timing_self_test(int verbose)
Checkup routine.
mbedtls_timing_set_delay
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().)
mbedtls_timing_hardclock
unsigned long mbedtls_timing_hardclock(void)
Return the CPU cycle counter value.
mbedtls_timing_alarmed
volatile int mbedtls_timing_alarmed
mbedtls_timing_get_delay
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.)
Generated on Tue Apr 15 2025 11:09:07 for Mbed TLS v2.28.10 by
1.9.7