mbed TLS v2.7.6
include
mbedtls
timing.h
Go to the documentation of this file.
1
6
/*
7
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
8
* SPDX-License-Identifier: Apache-2.0
9
*
10
* Licensed under the Apache License, Version 2.0 (the "License"); you may
11
* not use this file except in compliance with the License.
12
* You may obtain a copy of the License at
13
*
14
* http://www.apache.org/licenses/LICENSE-2.0
15
*
16
* Unless required by applicable law or agreed to in writing, software
17
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
* See the License for the specific language governing permissions and
20
* limitations under the License.
21
*
22
* This file is part of mbed TLS (https://tls.mbed.org)
23
*/
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
46
struct
mbedtls_timing_hr_time
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
;
59
}
mbedtls_timing_delay_context
;
60
61
extern
volatile
int
mbedtls_timing_alarmed
;
62
73
unsigned
long
mbedtls_timing_hardclock
(
void
);
74
92
unsigned
long
mbedtls_timing_get_timer
(
struct
mbedtls_timing_hr_time
*val,
int
reset );
93
104
void
mbedtls_set_alarm
(
int
seconds );
105
120
void
mbedtls_timing_set_delay
(
void
*data, uint32_t int_ms, uint32_t fin_ms );
121
134
int
mbedtls_timing_get_delay
(
void
*data );
135
136
#ifdef __cplusplus
137
}
138
#endif
139
140
#else
/* MBEDTLS_TIMING_ALT */
141
#include "timing_alt.h"
142
#endif
/* MBEDTLS_TIMING_ALT */
143
144
#ifdef __cplusplus
145
extern
"C"
{
146
#endif
147
148
#if defined(MBEDTLS_SELF_TEST)
149
154
int
mbedtls_timing_self_test
(
int
verbose );
155
#endif
156
157
#ifdef __cplusplus
158
}
159
#endif
160
161
#endif
/* timing.h */
mbedtls_timing_delay_context::int_ms
uint32_t int_ms
Definition:
timing.h:57
mbedtls_timing_hardclock
unsigned long mbedtls_timing_hardclock(void)
Return the CPU cycle counter value.
mbedtls_timing_hr_time::opaque
unsigned char opaque[32]
Definition:
timing.h:48
config.h
Configuration options (set of defines)
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_delay_context::fin_ms
uint32_t fin_ms
Definition:
timing.h:58
mbedtls_timing_delay_context
Context for mbedtls_timing_set/get_delay()
Definition:
timing.h:54
mbedtls_timing_alarmed
volatile int mbedtls_timing_alarmed
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_get_timer
unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset)
Return the elapsed time in milliseconds.
mbedtls_timing_hr_time
timer structure
Definition:
timing.h:46
mbedtls_timing_get_delay
int mbedtls_timing_get_delay(void *data)
Get the status of delays (Memory helper: number of delays passed.)
Generated on Fri Oct 12 2018 20:26:46 for mbed TLS v2.7.6 by
1.8.13