diff libtommath/bn_mp_init_copy.c @ 608:4fbf9a7556ed

Use mp_init_size() to avoid some mp_grow()s
author Matt Johnston <matt@ucc.asn.au>
date Fri, 18 Mar 2011 14:31:07 +0000
parents 5ff8218bcee9
children 60fc6476e044
line wrap: on
line diff
--- a/libtommath/bn_mp_init_copy.c	Wed Mar 02 13:23:27 2011 +0000
+++ b/libtommath/bn_mp_init_copy.c	Fri Mar 18 14:31:07 2011 +0000
@@ -20,7 +20,7 @@
 {
   int     res;
 
-  if ((res = mp_init (a)) != MP_OKAY) {
+  if ((res = mp_init_size (a, b->used)) != MP_OKAY) {
     return res;
   }
   return mp_copy (b, a);