mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-23 09:41:08 +00:00
Fix issues introduced when rebasing
This commit is contained in:
parent
491a3fe057
commit
714929bf0d
|
@ -33,22 +33,18 @@
|
||||||
#define polarssl_exit exit
|
#define polarssl_exit exit
|
||||||
#define polarssl_printf printf
|
#define polarssl_printf printf
|
||||||
#define polarssl_snprintf snprintf
|
#define polarssl_snprintf snprintf
|
||||||
#define polarssl_exit exit
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
#if !defined(POLARSSL_TIMING_C)
|
||||||
* For heap usage estimates, we need an estimate of the overhead per allocated
|
int main( void )
|
||||||
* block. ptmalloc2/3 (used in gnu libc for instance) uses 2 size_t per block,
|
{
|
||||||
* so use that as our baseline.
|
polarssl_printf("POLARSSL_TIMING_C not defined.\n");
|
||||||
*/
|
return( 0 );
|
||||||
#define MEM_BLOCK_OVERHEAD ( 2 * sizeof( size_t ) )
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
/*
|
#include <string.h>
|
||||||
* Size to use for the malloc buffer if MEMORY_BUFFER_ALLOC_C is defined.
|
|
||||||
*/
|
|
||||||
#define HEAP_SIZE (1u << 16) // 64k
|
|
||||||
|
|
||||||
#if defined(POLARSSL_TIMING_C)
|
|
||||||
#include "polarssl/timing.h"
|
#include "polarssl/timing.h"
|
||||||
|
|
||||||
#include "polarssl/md4.h"
|
#include "polarssl/md4.h"
|
||||||
|
@ -81,6 +77,18 @@
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For heap usage estimates, we need an estimate of the overhead per allocated
|
||||||
|
* block. ptmalloc2/3 (used in gnu libc for instance) uses 2 size_t per block,
|
||||||
|
* so use that as our baseline.
|
||||||
|
*/
|
||||||
|
#define MEM_BLOCK_OVERHEAD ( 2 * sizeof( size_t ) )
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Size to use for the malloc buffer if MEMORY_BUFFER_ALLOC_C is defined.
|
||||||
|
*/
|
||||||
|
#define HEAP_SIZE (1u << 16) // 64k
|
||||||
|
|
||||||
#define BUFSIZE 1024
|
#define BUFSIZE 1024
|
||||||
#define HEADER_FORMAT " %-24s : "
|
#define HEADER_FORMAT " %-24s : "
|
||||||
#define TITLE_LEN 25
|
#define TITLE_LEN 25
|
||||||
|
@ -184,13 +192,6 @@ do { \
|
||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
|
|
||||||
#if !defined(POLARSSL_TIMING_C)
|
|
||||||
int main( void )
|
|
||||||
{
|
|
||||||
polarssl_printf("POLARSSL_TIMING_C not defined.\n");
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static int myrand( void *rng_state, unsigned char *output, size_t len )
|
static int myrand( void *rng_state, unsigned char *output, size_t len )
|
||||||
{
|
{
|
||||||
size_t use_len;
|
size_t use_len;
|
||||||
|
@ -686,11 +687,11 @@ int main( int argc, char *argv[] )
|
||||||
ecdsa_write_signature( &ecdsa, buf, curve_info->size,
|
ecdsa_write_signature( &ecdsa, buf, curve_info->size,
|
||||||
tmp, &sig_len, myrand, NULL ) != 0 )
|
tmp, &sig_len, myrand, NULL ) != 0 )
|
||||||
{
|
{
|
||||||
exit( 1 );
|
polarssl_exit( 1 );
|
||||||
}
|
}
|
||||||
ecp_clear_precomputed( &ecdsa.grp );
|
ecp_clear_precomputed( &ecdsa.grp );
|
||||||
|
|
||||||
snprintf( title, sizeof( title ), "ECDSA-%s",
|
polarssl_snprintf( title, sizeof( title ), "ECDSA-%s",
|
||||||
curve_info->name );
|
curve_info->name );
|
||||||
TIME_PUBLIC( title, "verify",
|
TIME_PUBLIC( title, "verify",
|
||||||
ret = ecdsa_read_signature( &ecdsa, buf, curve_info->size,
|
ret = ecdsa_read_signature( &ecdsa, buf, curve_info->size,
|
||||||
|
@ -744,7 +745,7 @@ int main( int argc, char *argv[] )
|
||||||
if( ecp_use_known_dp( &ecdh.grp, POLARSSL_ECP_DP_M255 ) != 0 ||
|
if( ecp_use_known_dp( &ecdh.grp, POLARSSL_ECP_DP_M255 ) != 0 ||
|
||||||
ecdh_gen_public( &ecdh.grp, &ecdh.d, &ecdh.Qp, myrand, NULL ) != 0 )
|
ecdh_gen_public( &ecdh.grp, &ecdh.d, &ecdh.Qp, myrand, NULL ) != 0 )
|
||||||
{
|
{
|
||||||
exit( 1 );
|
polarssl_exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TIME_PUBLIC( "ECDHE-Curve25519", "handshake",
|
TIME_PUBLIC( "ECDHE-Curve25519", "handshake",
|
||||||
|
@ -770,7 +771,7 @@ int main( int argc, char *argv[] )
|
||||||
ecdh_make_public( &ecdh, &olen, buf, sizeof( buf),
|
ecdh_make_public( &ecdh, &olen, buf, sizeof( buf),
|
||||||
myrand, NULL ) != 0 )
|
myrand, NULL ) != 0 )
|
||||||
{
|
{
|
||||||
exit( 1 );
|
polarssl_exit( 1 );
|
||||||
}
|
}
|
||||||
ecp_clear_precomputed( &ecdh.grp );
|
ecp_clear_precomputed( &ecdh.grp );
|
||||||
|
|
||||||
|
@ -792,7 +793,7 @@ int main( int argc, char *argv[] )
|
||||||
myrand, NULL ) != 0 ||
|
myrand, NULL ) != 0 ||
|
||||||
ecdh_gen_public( &ecdh.grp, &ecdh.d, &ecdh.Q, myrand, NULL ) != 0 )
|
ecdh_gen_public( &ecdh.grp, &ecdh.d, &ecdh.Q, myrand, NULL ) != 0 )
|
||||||
{
|
{
|
||||||
exit( 1 );
|
polarssl_exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TIME_PUBLIC( "ECDH-Curve25519", "handshake",
|
TIME_PUBLIC( "ECDH-Curve25519", "handshake",
|
||||||
|
|
Loading…
Reference in a new issue