dslinux/user/dropbear/libtommath bn_mp_div.c

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

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

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: bn_mp_div.c
RCS file: /cvsroot/dslinux/dslinux/user/dropbear/libtommath/bn_mp_div.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bn_mp_div.c	22 May 2006 23:58:08 -0000	1.2
+++ bn_mp_div.c	22 Jul 2006 18:19:29 -0000	1.3
@@ -15,7 +15,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