commit | 044a86bde8b0fd3b185253f52715655541dacc60 | [log] [tgz] |
---|---|---|
author | Janos Follath <janos.follath@gmail.com> | Sun Oct 25 10:58:03 2015 +0100 |
committer | Janos Follath <janos.follath@gmail.com> | Sun Oct 25 10:58:03 2015 +0100 |
tree | 8eb332a8a8b2d35787ee79bd99e28735b7954955 | |
parent | c4e7d8a3817bbdee218328efa9e482217038152b [diff] [blame] |
Tests and fix added for #309 (inplace mpi doubling).
diff --git a/library/bignum.c b/library/bignum.c index 628a6ee..1b80200 100644 --- a/library/bignum.c +++ b/library/bignum.c
@@ -862,7 +862,12 @@ if( X == B ) { - const mbedtls_mpi *T = A; A = X; B = T; + const mbedtls_mpi *T; + + if( B == A) + return mbedtls_mpi_shift_l( X, 1 ); + + T = A; A = X; B = T; } if( X != A )