diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-17 15:30:32 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-17 15:30:32 (GMT) |
commit | 44774dc3238ca1e269c6acedcbdfb449780c96f9 (patch) | |
tree | 1f924b02e7e59fb0689e28bedd2d654a3f77cc02 /libtommath | |
parent | 7b09e3867d1705d3d223ae5383297ee336f03149 (diff) | |
download | tcl-44774dc3238ca1e269c6acedcbdfb449780c96f9.zip tcl-44774dc3238ca1e269c6acedcbdfb449780c96f9.tar.gz tcl-44774dc3238ca1e269c6acedcbdfb449780c96f9.tar.bz2 |
Restore bn_mp_radix_size.c to exact copy of libtommath-1.0 version: Since the radix_size of "9" should return 2, not 3. Add test-case to prove that.libtommath_1_0
Diffstat (limited to 'libtommath')
-rw-r--r-- | libtommath/bn_mp_radix_size.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/libtommath/bn_mp_radix_size.c b/libtommath/bn_mp_radix_size.c index 9c60401..e5d7772 100644 --- a/libtommath/bn_mp_radix_size.c +++ b/libtommath/bn_mp_radix_size.c @@ -66,17 +66,8 @@ int mp_radix_size (mp_int * a, int radix, int *size) } mp_clear (&t); - /* - * return digs + 1, the 1 is for the NULL byte that would be required. - * mp_toradix_n requires a minimum of 3 bytes, so never report less than - * that. - */ - - if ( digs >= 2 ) { - *size = digs + 1; - } else { - *size = 3; - } + /* return digs + 1, the 1 is for the NULL byte that would be required. */ + *size = digs + 1; return MP_OKAY; } |