Mbed TLS v4.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
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
#include "mbedtls/private_access.h"
13
14
#include "
mbedtls/build_info.h
"
15
16
#include <stdint.h>
17
18
#ifdef __cplusplus
19
extern
"C"
{
20
#endif
21
22
#if !defined(MBEDTLS_TIMING_ALT)
23
// Regular implementation
24
//
25
26
#if defined(MBEDTLS_HAVE_TIME)
27
#include <
mbedtls/platform_time.h
>
28
#endif
29
33
struct
mbedtls_timing_hr_time
{
34
#if defined(MBEDTLS_HAVE_TIME)
35
mbedtls_ms_time_t
ms
;
36
#else
37
/* Without MBEDTLS_HAVE_TIME, we expose the type definitions and
38
* function declarations, but they can't be implemented. We do
39
* need to write something here. */
40
unsigned
MBEDTLS_PRIVATE(unused);
41
#endif
42
};
43
47
typedef
struct
mbedtls_timing_delay_context
{
48
struct
mbedtls_timing_hr_time
MBEDTLS_PRIVATE(timer);
49
uint32_t MBEDTLS_PRIVATE(int_ms);
50
uint32_t MBEDTLS_PRIVATE(fin_ms);
51
}
mbedtls_timing_delay_context
;
52
53
#else
/* MBEDTLS_TIMING_ALT */
54
#include "
timing_alt.h
"
55
#endif
/* MBEDTLS_TIMING_ALT */
56
57
/* Internal use */
58
unsigned
long
long
mbedtls_timing_get_timer
(
struct
mbedtls_timing_hr_time
*val,
int
reset);
59
74
void
mbedtls_timing_set_delay
(
void
*data, uint32_t int_ms, uint32_t fin_ms);
75
88
int
mbedtls_timing_get_delay
(
void
*data);
89
98
uint32_t
mbedtls_timing_get_final_delay
(
99
const
mbedtls_timing_delay_context
*data);
100
101
#ifdef __cplusplus
102
}
103
#endif
104
105
#endif
/* timing.h */
build_info.h
Build-time configuration info.
platform_time.h
Mbed TLS Platform time abstraction.
mbedtls_ms_time_t
int64_t mbedtls_ms_time_t
Definition
platform_time.h:35
mbedtls_timing_delay_context
Context for mbedtls_timing_set/get_delay().
Definition
timing.h:47
mbedtls_timing_hr_time
timer structure
Definition
timing.h:33
mbedtls_timing_hr_time::ms
mbedtls_ms_time_t ms
Definition
timing.h:35
mbedtls_timing_get_final_delay
uint32_t mbedtls_timing_get_final_delay(const mbedtls_timing_delay_context *data)
Get the final timing delay.
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_get_timer
unsigned long long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset)
mbedtls_timing_get_delay
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.).
timing_alt.h
include
mbedtls
timing.h
Generated on
for Mbed TLS v4.1.1 by
1.17.0