Loading...
Searching...
No Matches
timing.h
Go to the documentation of this file.
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef MBEDTLS_TIMING_H
#define MBEDTLS_TIMING_H
#include "mbedtls/private_access.h"
#include "mbedtls/build_info.h"
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(MBEDTLS_TIMING_ALT)
// Regular implementation
//
struct mbedtls_timing_hr_time {
uint64_t MBEDTLS_PRIVATE(opaque)[4];
};
typedef struct mbedtls_timing_delay_context {
struct mbedtls_timing_hr_time MBEDTLS_PRIVATE(timer);
uint32_t MBEDTLS_PRIVATE(int_ms);
uint32_t MBEDTLS_PRIVATE(fin_ms);
} mbedtls_timing_delay_context;
#else /* MBEDTLS_TIMING_ALT */
#include "timing_alt.h"
#endif /* MBEDTLS_TIMING_ALT */
/* Internal use */
unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset);
void mbedtls_timing_set_delay(void *data, uint32_t int_ms, uint32_t fin_ms);
int mbedtls_timing_get_delay(void *data);
uint32_t mbedtls_timing_get_final_delay(
const mbedtls_timing_delay_context *data);
#ifdef __cplusplus
}
#endif
#endif /* timing.h */
build_info.h
Build-time configuration info.
private_access.h
Macro wrapper for struct's members.
MBEDTLS_PRIVATE
#define MBEDTLS_PRIVATE(member)
Definition private_access.h:15
mbedtls_timing_delay_context
Context for mbedtls_timing_set/get_delay().
Definition timing.h:36
mbedtls_timing_hr_time
timer structure
Definition timing.h:29
mbedtls_timing_get_timer
unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset)
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_delay
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.).
timing_alt.h