dslinux/user/dropbear/libtommath/pre_gen mpi.c

stsp stsp at user.in-berlin.de
Sat Jul 22 20:19:31 CEST 2006

Update of /cvsroot/dslinux/dslinux/user/dropbear/libtommath/pre_gen
In directory antilope:/tmp/cvs-serv29504/libtommath/pre_gen

Modified Files:
Log Message:
Open /dev/urandom instead of /dev/random since we have no proper entropy
source yet.

Fix annoying data abort - the crash was in a function called __udivdi3,
which is apparently provided by the toolchain. The 'smaller' of the two
mp_div functions in libtommath does not get linked with __udivdi3,
and does not crash. So use it instead of the 'faster' one.
We should probably fix __udivdi3 in our toolchain in the long term.

Index: mpi.c
RCS file: /cvsroot/dslinux/dslinux/user/dropbear/libtommath/pre_gen/mpi.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mpi.c	22 May 2006 23:58:10 -0000	1.2
+++ mpi.c	22 Jul 2006 18:19:29 -0000	1.3
@@ -1488,7 +1488,8 @@
  * Tom St Denis, tomstdenis at iahu.ca, http://math.libtomcrypt.org
+//#ifdef BN_MP_DIV_SMALL
+#if 1
 /* slower bit-bang division... also smaller */
 int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d)

More information about the dslinux-commit mailing list