Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
mbedtls
Commits
f02c5642
Commit
f02c5642
authored
Nov 13, 2012
by
Paul Bakker
Browse files
- Allow R and A to point to same mpi in mpi_div_mpi
parent
36c4a678
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
ChangeLog
ChangeLog
+2
-0
library/bignum.c
library/bignum.c
+1
-1
tests/suites/test_suite_mpi.function
tests/suites/test_suite_mpi.function
+5
-5
No files found.
ChangeLog
View file @
f02c5642
...
...
@@ -4,6 +4,8 @@ PolarSSL ChangeLog
Bugfixes
* Fixes for MSVC6
* Moved mpi_inv_mod() outside POLARSSL_GENPRIME
* Allow R and A to point to same mpi in mpi_div_mpi (found by Manuel
Pégourié-Gonnard)
= Version 1.2.0 released 2012-10-31
Features
...
...
library/bignum.c
View file @
f02c5642
...
...
@@ -1195,9 +1195,9 @@ int mpi_div_mpi( mpi *Q, mpi *R, const mpi *A, const mpi *B )
if
(
R
!=
NULL
)
{
mpi_shift_r
(
&
X
,
k
);
X
.
s
=
A
->
s
;
mpi_copy
(
R
,
&
X
);
R
->
s
=
A
->
s
;
if
(
mpi_cmp_int
(
R
,
0
)
==
0
)
R
->
s
=
1
;
}
...
...
tests/suites/test_suite_mpi.function
View file @
f02c5642
...
...
@@ -514,21 +514,21 @@ END_CASE
BEGIN_CASE
mpi_mod_mpi:radix_X:input_X:radix_Y:input_Y:radix_A:input_A:div_result
{
mpi X, Y,
Z,
A;
mpi X, Y, A;
int res;
mpi_init( &X ); mpi_init( &Y ); mpi_init(
&Z ); mpi_init(
&A );
mpi_init( &X ); mpi_init( &Y ); mpi_init( &A );
TEST_ASSERT( mpi_read_string( &X, {radix_X}, {input_X} ) == 0 );
TEST_ASSERT( mpi_read_string( &Y, {radix_Y}, {input_Y} ) == 0 );
TEST_ASSERT( mpi_read_string( &A, {radix_A}, {input_A} ) == 0 );
res = mpi_mod_mpi( &
Z
, &X, &Y );
res = mpi_mod_mpi( &
X
, &X, &Y );
TEST_ASSERT( res == {div_result} );
if( res == 0 )
{
TEST_ASSERT( mpi_cmp_mpi( &
Z
, &A ) == 0 );
TEST_ASSERT( mpi_cmp_mpi( &
X
, &A ) == 0 );
}
mpi_free( &X ); mpi_free( &Y ); mpi_free(
&Z ); mpi_free(
&A );
mpi_free( &X ); mpi_free( &Y ); mpi_free( &A );
}
END_CASE
...
...
Erwan Croze
👋🏻
@erwan.croze
mentioned in commit
0ae1f402
·
Jun 29, 2018
mentioned in commit
0ae1f402
mentioned in commit 0ae1f40299a816771acc920fed136318f7b7917b
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment