mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge pull request #6449 from gilles-peskine-arm/bignum-core-shift_r
Bignum core: shift_r
This commit is contained in:
@ -338,6 +338,26 @@ exit:
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void mpi_core_shift_r( char *input, int count, char *result )
|
||||
{
|
||||
mbedtls_mpi_uint *X = NULL;
|
||||
mbedtls_mpi_uint *Y = NULL;
|
||||
size_t limbs, n;
|
||||
|
||||
TEST_EQUAL( 0, mbedtls_test_read_mpi_core( &X, &limbs, input ) );
|
||||
TEST_EQUAL( 0, mbedtls_test_read_mpi_core( &Y, &n, result ) );
|
||||
TEST_EQUAL( limbs, n );
|
||||
|
||||
mbedtls_mpi_core_shift_r( X, limbs, count );
|
||||
ASSERT_COMPARE( X, limbs * ciL, Y, limbs * ciL );
|
||||
|
||||
exit:
|
||||
mbedtls_free( X );
|
||||
mbedtls_free( Y );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void mpi_core_add_if( char * input_A, char * input_B,
|
||||
char * input_S, int carry )
|
||||
|
Reference in New Issue
Block a user