Lines Matching +full:mbed +full:- +full:os
4 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
5 * SPDX-License-Identifier: Apache-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
19 * This file is part of mbed TLS (https://tls.mbed.org)
27 printf("this version of this program only works on mbed OS\n"); in main()
74 #include "mbed-drivers/mbed.h"
81 "-----BEGIN RSA PRIVATE KEY-----\r\n" \
107 "-----END RSA PRIVATE KEY-----\r\n"
110 "-----BEGIN RSA PRIVATE KEY-----\r\n" \
160 "-----END RSA PRIVATE KEY-----\r\n"
179 #define HEADER_FORMAT " %-24s : "
194 mbedtls_printf( "FAILED: -0x%04x\r\n", -ret );
203 CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; in mbedtls_timing_hardclock()
204 DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; in mbedtls_timing_hardclock()
207 return( DWT->CYCCNT ); in mbedtls_timing_hardclock()
234 ( mbedtls_timing_hardclock() - tsc ) / ( j * BUFSIZE ) ); \
243 mbedtls_printf( "FAILED: -0x%04x\r\n", -ret );
256 for( i = 12 - title_len; i != 0; i-- ) mbedtls_printf( " " ); \
257 max_used -= prv_used; \
258 max_blocks -= prv_blocks; \
311 len -= use_len; in myrand()
323 if( grp->T != NULL ) in ecp_clear_precomputed()
326 for( i = 0; i < grp->T_size; i++ ) in ecp_clear_precomputed()
327 mbedtls_ecp_point_free( &grp->T[i] ); in ecp_clear_precomputed()
328 mbedtls_free( grp->T ); in ecp_clear_precomputed()
330 grp->T = NULL; in ecp_clear_precomputed()
331 grp->T_size = 0; in ecp_clear_precomputed()
441 TIME_AND_TSC( "SHA-1", mbedtls_sha1( buf, BUFSIZE, tmp ) ); in benchmark()
446 TIME_AND_TSC( "SHA-256", mbedtls_sha256( buf, BUFSIZE, tmp, 0 ) ); in benchmark()
451 TIME_AND_TSC( "SHA-512", mbedtls_sha512( buf, BUFSIZE, tmp, 0 ) ); in benchmark()
496 mbedtls_snprintf( title, sizeof( title ), "AES-CBC-%d", keysize ); in benchmark()
517 mbedtls_snprintf( title, sizeof( title ), "AES-GCM-%d", keysize ); in benchmark()
540 mbedtls_snprintf( title, sizeof( title ), "AES-CCM-%d", keysize ); in benchmark()
564 mbedtls_snprintf( title, sizeof( title ), "CAMELLIA-CBC-%d", keysize ); in benchmark()
587 mbedtls_snprintf( title, sizeof( title ), "BLOWFISH-CBC-%d", keysize ); in benchmark()
649 TIME_AND_TSC( "HMAC_DRBG SHA-1 (NOPR)", in benchmark()
658 TIME_AND_TSC( "HMAC_DRBG SHA-1 (PR)", in benchmark()
670 TIME_AND_TSC( "HMAC_DRBG SHA-256 (NOPR)", in benchmark()
679 TIME_AND_TSC( "HMAC_DRBG SHA-256 (PR)", in benchmark()
703 mbedtls_snprintf( title, sizeof( title ), "RSA-%d", mbedtls_pk_get_bitlen( &pk ) ); in benchmark()
748 mbedtls_snprintf( title, sizeof( title ), "DHE-%d", dhm_sizes[i] ); in benchmark()
754 mbedtls_snprintf( title, sizeof( title ), "DH-%d", dhm_sizes[i] ); in benchmark()
773 curve_info->grp_id != MBEDTLS_ECP_DP_NONE; in benchmark()
778 if( mbedtls_ecdsa_genkey( &ecdsa, curve_info->grp_id, myrand, NULL ) != 0 ) in benchmark()
782 mbedtls_snprintf( title, sizeof( title ), "ECDSA-%s", in benchmark()
783 curve_info->name ); in benchmark()
785 … ret = mbedtls_ecdsa_write_signature( &ecdsa, MBEDTLS_MD_SHA256, buf, curve_info->bit_size, in benchmark()
792 curve_info->grp_id != MBEDTLS_ECP_DP_NONE; in benchmark()
797 if( mbedtls_ecdsa_genkey( &ecdsa, curve_info->grp_id, myrand, NULL ) != 0 || in benchmark()
798 mbedtls_ecdsa_write_signature( &ecdsa, MBEDTLS_MD_SHA256, buf, curve_info->bit_size, in benchmark()
805 mbedtls_snprintf( title, sizeof( title ), "ECDSA-%s", in benchmark()
806 curve_info->name ); in benchmark()
808 ret = mbedtls_ecdsa_read_signature( &ecdsa, buf, curve_info->bit_size, in benchmark()
827 curve_info->grp_id != MBEDTLS_ECP_DP_NONE; in benchmark()
832 if( mbedtls_ecp_group_load( &ecdh.grp, curve_info->grp_id ) != 0 || in benchmark()
841 mbedtls_snprintf( title, sizeof( title ), "ECDHE-%s", in benchmark()
842 curve_info->name ); in benchmark()
862 TIME_PUBLIC( "ECDHE-Curve25519", "handshake", in benchmark()
873 curve_info->grp_id != MBEDTLS_ECP_DP_NONE; in benchmark()
878 if( mbedtls_ecp_group_load( &ecdh.grp, curve_info->grp_id ) != 0 || in benchmark()
889 mbedtls_snprintf( title, sizeof( title ), "ECDH-%s", in benchmark()
890 curve_info->name ); in benchmark()
910 TIME_PUBLIC( "ECDH-Curve25519", "handshake", in benchmark()
934 #include "mbed-drivers/test_env.h"
940 MBED_HOSTTEST_DESCRIPTION(mbed TLS benchmark program); in run()
948 minar::Scheduler::postCallback(mbed::util::FunctionPointer0<void>(run).bind()); in app_start()