Mbed TLS v4.1.1
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
19extern "C" {
20#endif
21
22#if !defined(MBEDTLS_TIMING_ALT)
23// Regular implementation
24//
25
26#if defined(MBEDTLS_HAVE_TIME)
28#endif
29
34#if defined(MBEDTLS_HAVE_TIME)
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
48 struct mbedtls_timing_hr_time MBEDTLS_PRIVATE(timer);
49 uint32_t MBEDTLS_PRIVATE(int_ms);
50 uint32_t MBEDTLS_PRIVATE(fin_ms);
52
53#else /* MBEDTLS_TIMING_ALT */
54#include "timing_alt.h"
55#endif /* MBEDTLS_TIMING_ALT */
56
57/* Internal use */
58unsigned long long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset);
59
74void mbedtls_timing_set_delay(void *data, uint32_t int_ms, uint32_t fin_ms);
75
89
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif /* timing.h */
Build-time configuration info.
Mbed TLS Platform time abstraction.
int64_t mbedtls_ms_time_t
Context for mbedtls_timing_set/get_delay().
Definition timing.h:47
timer structure
Definition timing.h:33
mbedtls_ms_time_t ms
Definition timing.h:35
uint32_t mbedtls_timing_get_final_delay(const mbedtls_timing_delay_context *data)
Get the final timing 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().).
unsigned long long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset)
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.).