mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Add mpi_shrink()
This commit is contained in:
parent
e282012219
commit
5868163e07
4 changed files with 90 additions and 0 deletions
|
|
@ -292,6 +292,22 @@ void mpi_copy_self( int input_X )
|
|||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void mpi_shrink( int before, int used, int min, int after )
|
||||
{
|
||||
mpi X;
|
||||
mpi_init( &X );
|
||||
|
||||
TEST_ASSERT( mpi_grow( &X, before ) == 0 );
|
||||
TEST_ASSERT( used <= before );
|
||||
memset( X.p, 0x2a, used * sizeof( t_uint ) );
|
||||
TEST_ASSERT( mpi_shrink( &X, min ) == 0 );
|
||||
TEST_ASSERT( X.n == (size_t) after );
|
||||
|
||||
mpi_free( &X );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void mpi_swap( int input_X, int input_Y )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue