On Thu, 22 May 2003, Clifford Heath wrote:

> Ted Rolle wrote:
> > Putting it into bignum.c is arguably the best way.
>
> .... and then implement the powmod operation using one of the
> established (advanced!) methods, like the Chinese remainder
> theorem, and then recode the whole thing in assembler (which
> *does* buy a lot of speed).
>
> Or you could be sensible, and just import the appropriate code
> from OpenSSL/SSLeay, where Eric Young has already done all
> this, spending weeks of effort and beating the best commercial
> implementations. IIRC his licensing terms merely require
> acknowledgement.
>
Yes, thats probably the way. Do you think OpenSSL's implementation is
faster/simpler/better than the one in libgcrypt (which in turn is based on
multi-precision part of Gnu Scientific Lib)?

Do you happen to know how similar OpenSSL's and/or libgcrypt's
multi-precision libs are to Ruby's? (Matz, what code was bignum originally
based on?). It might simplify things if the representation of ruby's
bignums internally is close to the implementation we chose to base it on.

Regards,

Robert