Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
mbedtls
Commits
f2561b3f
Commit
f2561b3f
authored
Feb 06, 2014
by
Paul Bakker
Browse files
Ability to provide alternate timing implementation
parent
64abd83b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
ChangeLog
ChangeLog
+1
-0
include/polarssl/config.h
include/polarssl/config.h
+13
-0
include/polarssl/timing.h
include/polarssl/timing.h
+11
-1
library/timing.c
library/timing.c
+2
-2
No files found.
ChangeLog
View file @
f2561b3f
...
...
@@ -10,6 +10,7 @@ Features
* Support for RSASSA-PSS keys and signatures in certificates, CSRs
and CRLs
* Single Platform compatilibity layer (for memory / printf / fprintf)
* Ability to provide alternate timing implementation
Changes
* Deprecated the Memory layer
...
...
include/polarssl/config.h
View file @
f2561b3f
...
...
@@ -159,6 +159,19 @@
* \{
*/
/**
* \def POLARSSL_TIMING_ALT
*
* Uncomment to provide your own alternate implementation for hardclock(),
* get_timer(), set_alarm() and m_sleep().
*
* Only works if you have POLARSSL_TIMING_C enabled.
*
* You will need to provide a header "timing_alt.h" and an implementation at
* compile time.
*/
//#define POLARSSL_TIMING_ALT
/**
* \def POLARSSL_XXX_ALT
*
...
...
include/polarssl/timing.h
View file @
f2561b3f
...
...
@@ -3,7 +3,7 @@
*
* \brief Portable interface to the CPU cycle counter
*
* Copyright (C) 2006-201
3
, Brainspark B.V.
* Copyright (C) 2006-201
4
, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
...
...
@@ -27,6 +27,12 @@
#ifndef POLARSSL_TIMING_H
#define POLARSSL_TIMING_H
#include "config.h"
#if !defined(POLARSSL_TIMING_ALT)
// Regular implementation
//
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -72,4 +78,8 @@ void m_sleep( int milliseconds );
}
#endif
#else
/* POLARSSL_TIMING_ALT */
#include "timing_alt.h"
#endif
/* POLARSSL_TIMING_ALT */
#endif
/* timing.h */
library/timing.c
View file @
f2561b3f
/*
* Portable interface to the CPU cycle counter
*
* Copyright (C) 2006-201
0
, Brainspark B.V.
* Copyright (C) 2006-201
4
, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
...
...
@@ -25,7 +25,7 @@
#include "polarssl/config.h"
#if defined(POLARSSL_TIMING_C)
#if defined(POLARSSL_TIMING_C)
&& !defined(POLARSSL_TIMING_ALT)
#include "polarssl/timing.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment