mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-06 14:38:57 +01:00
Merge branch 'development-restricted' into iotssl-1260-non-blocking-ecc-restricted
* development-restricted: (578 commits)
Update library version number to 2.13.1
Don't define _POSIX_C_SOURCE in header file
Don't declare and define gmtime()-mutex on Windows platforms
Correct preprocessor guards determining use of gmtime()
Correct documentation of mbedtls_platform_gmtime_r()
Correct typo in documentation of mbedtls_platform_gmtime_r()
Correct POSIX version check to determine presence of gmtime_r()
Improve documentation of mbedtls_platform_gmtime_r()
platform_utils.{c/h} -> platform_util.{c/h}
Don't include platform_time.h if !MBEDTLS_HAVE_TIME
Improve wording of documentation of MBEDTLS_PLATFORM_GMTIME_R_ALT
Fix typo in documentation of MBEDTLS_PLATFORM_GMTIME_R_ALT
Replace 'thread safe' by 'thread-safe' in the documentation
Improve documentation of MBEDTLS_HAVE_TIME_DATE
ChangeLog: Add missing renamings gmtime -> gmtime_r
Improve documentation of MBEDTLS_HAVE_TIME_DATE
Minor documentation improvements
Style: Add missing period in documentation in threading.h
Rename mbedtls_platform_gmtime() to mbedtls_platform_gmtime_r()
Guard decl and use of gmtime mutex by HAVE_TIME_DATE and !GMTIME_ALT
...
This commit is contained in:
commit
125af948c3
241 changed files with 18474 additions and 5839 deletions
|
|
@ -43,15 +43,13 @@ exit:
|
|||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void ecdh_primitive_testvec( int id, char *dA_str, char *xA_str, char *yA_str,
|
||||
char *dB_str, char *xB_str, char *yB_str,
|
||||
char *z_str )
|
||||
void ecdh_primitive_testvec( int id, data_t * rnd_buf_A, char * xA_str,
|
||||
char * yA_str, data_t * rnd_buf_B,
|
||||
char * xB_str, char * yB_str, char * z_str )
|
||||
{
|
||||
mbedtls_ecp_group grp;
|
||||
mbedtls_ecp_point qA, qB;
|
||||
mbedtls_mpi dA, dB, zA, zB, check;
|
||||
unsigned char rnd_buf_A[MBEDTLS_ECP_MAX_BYTES];
|
||||
unsigned char rnd_buf_B[MBEDTLS_ECP_MAX_BYTES];
|
||||
rnd_buf_info rnd_info_A, rnd_info_B;
|
||||
|
||||
mbedtls_ecp_group_init( &grp );
|
||||
|
|
@ -61,36 +59,36 @@ void ecdh_primitive_testvec( int id, char *dA_str, char *xA_str, char *yA_str,
|
|||
|
||||
TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 );
|
||||
|
||||
rnd_info_A.buf = rnd_buf_A;
|
||||
rnd_info_A.length = unhexify( rnd_buf_A, dA_str );
|
||||
rnd_info_A.buf = rnd_buf_A->x;
|
||||
rnd_info_A.length = rnd_buf_A->len;
|
||||
|
||||
/* Fix rnd_buf_A by shifting it left if necessary */
|
||||
/* Fix rnd_buf_A->x by shifting it left if necessary */
|
||||
if( grp.nbits % 8 != 0 )
|
||||
{
|
||||
unsigned char shift = 8 - ( grp.nbits % 8 );
|
||||
size_t i;
|
||||
|
||||
for( i = 0; i < rnd_info_A.length - 1; i++ )
|
||||
rnd_buf_A[i] = rnd_buf_A[i] << shift
|
||||
| rnd_buf_A[i+1] >> ( 8 - shift );
|
||||
rnd_buf_A->x[i] = rnd_buf_A->x[i] << shift
|
||||
| rnd_buf_A->x[i+1] >> ( 8 - shift );
|
||||
|
||||
rnd_buf_A[rnd_info_A.length-1] <<= shift;
|
||||
rnd_buf_A->x[rnd_info_A.length-1] <<= shift;
|
||||
}
|
||||
|
||||
rnd_info_B.buf = rnd_buf_B;
|
||||
rnd_info_B.length = unhexify( rnd_buf_B, dB_str );
|
||||
rnd_info_B.buf = rnd_buf_B->x;
|
||||
rnd_info_B.length = rnd_buf_B->len;
|
||||
|
||||
/* Fix rnd_buf_B by shifting it left if necessary */
|
||||
/* Fix rnd_buf_B->x by shifting it left if necessary */
|
||||
if( grp.nbits % 8 != 0 )
|
||||
{
|
||||
unsigned char shift = 8 - ( grp.nbits % 8 );
|
||||
size_t i;
|
||||
|
||||
for( i = 0; i < rnd_info_B.length - 1; i++ )
|
||||
rnd_buf_B[i] = rnd_buf_B[i] << shift
|
||||
| rnd_buf_B[i+1] >> ( 8 - shift );
|
||||
rnd_buf_B->x[i] = rnd_buf_B->x[i] << shift
|
||||
| rnd_buf_B->x[i+1] >> ( 8 - shift );
|
||||
|
||||
rnd_buf_B[rnd_info_B.length-1] <<= shift;
|
||||
rnd_buf_B->x[rnd_info_B.length-1] <<= shift;
|
||||
}
|
||||
|
||||
TEST_ASSERT( mbedtls_ecdh_gen_public( &grp, &dA, &qA,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue