[Verse-dev] v_bignum.c and 64-bit processors
Lauri Savioja
las at tml.hut.fi
Sat May 7 08:17:19 CEST 2005
Hi Emil,
Luckily, we will have a Fujitsu laptop with AMD Ahtlon64 with us next
week :-).
Regards,
Lauri
On Fri, 06 May 2005, Emil Brink wrote:
> On Fri, 6 May 2005 13:01:14 +0300 (EEST)
> Samuel Siltanen <saasilta at cc.hut.fi> wrote:
>
> > I found a bug in v_bignum.c, which causes the encryption key generation to
> > last extremely long on 64-bit architecture (such as AMD Athlon64). In such
> > architectures long ints and addresses are 64 bits long instead of 32 bits.
> > That is why the encryption key generation times are orders of magnitude
> > longer than on 32-bit architecture (I guess exactly 2^32 times longer),
> > which is too long.
> >
> > I fixed the problem by substituting the longs (64-bit) by ints (32-bit)
> > in v_bignum.c.
>
> Oh, that's really interesting. Too bad that (I assume, feel free to
> correct me) you won't be bringing any 64-bit hardware to the meeting
> next week, I would love to get my hands on some.
>
> I don't currently understand why it takes more time, I would have expected
> it to "just work" but I guess I'm sometimes overly optimistic. One thing
> you could try if you feel up to it is to make the definition of the
> VBigDig type in v_bignum.h "unsigned int" instead of "unsigned short",
> that should make the computations work on "digits" of 32 bits rather than
> 16 bits, and thus be faster. I haven't ever tried that out though, so I
> don't know if it works or not.
>
> Also, there *should* be a "VBigDigs" or something type, that can hold
> two digits. The current code uses "unsigned long" for that case, as you
> noticed. This shouldn't be too hard to add.
>
> Regards,
>
> /Emil
> _______________________________________________
> Verse-dev mailing list
> Verse-dev at projects.blender.org
> http://projects.blender.org/mailman/listinfo/verse-dev
--
Lauri Savioja
Telecommunications Software and Multimedia Laboratory
Helsinki University of Technology
PO Box 5400, FIN-02015 HUT, Finland
Tel. +358-9-451 3237 Fax +358-9-451 5014
More information about the Verse-dev
mailing list