mbed TLS upgraded to 2.6.0

Fork of mbedtls by Mark Radbourne

Committer:
Jasper Wallace
Date:
Fri Sep 29 19:50:30 2017 +0100
Revision:
2:bbdeda018a3c
Parent:
1:9ebc941037d5
Update to mbedtls 2.6.0, many changes.

Changes to mbedtls sources made:

in include/mbedtls/config.h comment out:

#define MBEDTLS_FS_IO
#define MBEDTLS_NET_C
#define MBEDTLS_TIMING_C

uncomment:

#define MBEDTLS_NO_PLATFORM_ENTROPY

remove the following directorys:

programs
yotta
visualc

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jasper Wallace 1:9ebc941037d5 1 #!/bin/sh
Jasper Wallace 1:9ebc941037d5 2
Jasper Wallace 1:9ebc941037d5 3 # Measure heap usage (and performance) of ECC operations with various values of
Jasper Wallace 1:9ebc941037d5 4 # the relevant tunable compile-time parameters.
Jasper Wallace 1:9ebc941037d5 5 #
Jasper Wallace 1:9ebc941037d5 6 # Usage (preferably on a 32-bit platform):
Jasper Wallace 1:9ebc941037d5 7 # cmake -D CMAKE_BUILD_TYPE=Release .
Jasper Wallace 1:9ebc941037d5 8 # scripts/ecc-heap.sh | tee ecc-heap.log
Jasper Wallace 1:9ebc941037d5 9
Jasper Wallace 1:9ebc941037d5 10 set -eu
Jasper Wallace 1:9ebc941037d5 11
Jasper Wallace 1:9ebc941037d5 12 CONFIG_H='include/mbedtls/config.h'
Jasper Wallace 1:9ebc941037d5 13
Jasper Wallace 1:9ebc941037d5 14 if [ -r $CONFIG_H ]; then :; else
Jasper Wallace 1:9ebc941037d5 15 echo "$CONFIG_H not found" >&2
Jasper Wallace 1:9ebc941037d5 16 exit 1
Jasper Wallace 1:9ebc941037d5 17 fi
Jasper Wallace 1:9ebc941037d5 18
Jasper Wallace 1:9ebc941037d5 19 if grep -i cmake Makefile >/dev/null; then :; else
Jasper Wallace 1:9ebc941037d5 20 echo "Needs Cmake" >&2
Jasper Wallace 1:9ebc941037d5 21 exit 1
Jasper Wallace 1:9ebc941037d5 22 fi
Jasper Wallace 1:9ebc941037d5 23
Jasper Wallace 1:9ebc941037d5 24 if git status | grep -F $CONFIG_H >/dev/null 2>&1; then
Jasper Wallace 1:9ebc941037d5 25 echo "config.h not clean" >&2
Jasper Wallace 1:9ebc941037d5 26 exit 1
Jasper Wallace 1:9ebc941037d5 27 fi
Jasper Wallace 1:9ebc941037d5 28
Jasper Wallace 1:9ebc941037d5 29 CONFIG_BAK=${CONFIG_H}.bak
Jasper Wallace 1:9ebc941037d5 30 cp $CONFIG_H $CONFIG_BAK
Jasper Wallace 1:9ebc941037d5 31
Jasper Wallace 1:9ebc941037d5 32 cat << EOF >$CONFIG_H
Jasper Wallace 1:9ebc941037d5 33 #define MBEDTLS_PLATFORM_C
Jasper Wallace 1:9ebc941037d5 34 #define MBEDTLS_PLATFORM_MEMORY
Jasper Wallace 1:9ebc941037d5 35 #define MBEDTLS_MEMORY_BUFFER_ALLOC_C
Jasper Wallace 1:9ebc941037d5 36 #define MBEDTLS_MEMORY_DEBUG
Jasper Wallace 1:9ebc941037d5 37
Jasper Wallace 1:9ebc941037d5 38 #define MBEDTLS_TIMING_C
Jasper Wallace 1:9ebc941037d5 39
Jasper Wallace 1:9ebc941037d5 40 #define MBEDTLS_BIGNUM_C
Jasper Wallace 1:9ebc941037d5 41 #define MBEDTLS_ECP_C
Jasper Wallace 1:9ebc941037d5 42 #define MBEDTLS_ASN1_PARSE_C
Jasper Wallace 1:9ebc941037d5 43 #define MBEDTLS_ASN1_WRITE_C
Jasper Wallace 1:9ebc941037d5 44 #define MBEDTLS_ECDSA_C
Jasper Wallace 1:9ebc941037d5 45 #define MBEDTLS_ECDH_C
Jasper Wallace 1:9ebc941037d5 46
Jasper Wallace 1:9ebc941037d5 47 #define MBEDTLS_ECP_DP_SECP192R1_ENABLED
Jasper Wallace 1:9ebc941037d5 48 #define MBEDTLS_ECP_DP_SECP224R1_ENABLED
Jasper Wallace 1:9ebc941037d5 49 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
Jasper Wallace 1:9ebc941037d5 50 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
Jasper Wallace 1:9ebc941037d5 51 #define MBEDTLS_ECP_DP_SECP521R1_ENABLED
Jasper Wallace 1:9ebc941037d5 52 #define MBEDTLS_ECP_DP_CURVE25519_ENABLED
Jasper Wallace 1:9ebc941037d5 53
Jasper Wallace 1:9ebc941037d5 54 #include "check_config.h"
Jasper Wallace 1:9ebc941037d5 55
Jasper Wallace 1:9ebc941037d5 56 //#define MBEDTLS_ECP_WINDOW_SIZE 6
Jasper Wallace 1:9ebc941037d5 57 //#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1
Jasper Wallace 1:9ebc941037d5 58 EOF
Jasper Wallace 1:9ebc941037d5 59
Jasper Wallace 1:9ebc941037d5 60 for F in 0 1; do
Jasper Wallace 1:9ebc941037d5 61 for W in 2 3 4 5 6; do
Jasper Wallace 1:9ebc941037d5 62 scripts/config.pl set MBEDTLS_ECP_WINDOW_SIZE $W
Jasper Wallace 1:9ebc941037d5 63 scripts/config.pl set MBEDTLS_ECP_FIXED_POINT_OPTIM $F
Jasper Wallace 1:9ebc941037d5 64 make benchmark >/dev/null 2>&1
Jasper Wallace 1:9ebc941037d5 65 echo "fixed point optim = $F, max window size = $W"
Jasper Wallace 1:9ebc941037d5 66 echo "--------------------------------------------"
Jasper Wallace 1:9ebc941037d5 67 programs/test/benchmark
Jasper Wallace 1:9ebc941037d5 68 done
Jasper Wallace 1:9ebc941037d5 69 done
Jasper Wallace 1:9ebc941037d5 70
Jasper Wallace 1:9ebc941037d5 71 # cleanup
Jasper Wallace 1:9ebc941037d5 72
Jasper Wallace 1:9ebc941037d5 73 mv $CONFIG_BAK $CONFIG_H
Jasper Wallace 1:9ebc941037d5 74 make clean