Version française
Home     About     Download     Resources     Contact us    
Browse thread
Big_int a^x mod m
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Julian Assange <proff@i...>
Subject: Re: Big_int a^x mod m
Julian Assange <proff@iq.org> writes:

>  val (**/) : num -> num -> num 
>  val power_num : num -> num -> num
>    Exponentiation
> 
> The num library documentation doesn't seem to support modular
> exponentiation. This is seems to be an unusual oversight, and means
> the library isn't useful for real-world cryptographic applications.
> 
> Is anyone working on adding mod exp's? Or are there other bigint
> ocaml libraries?

Following this up, there is the fast Numerix library, an extended
replacement for Big_int, which also contains a subset of bindings to
libgmp (Numerix native code is usally faster than gmp2.x -- but it's
worth noting that gmp3.0 has recently been released).

It would be nice to see this library replace Big_int entirely,
with wrappers for for backwards compatability.

Unfortunately Numerix doesn't support modular exponents either,
although it does support a lot of other nice operations that Big_int
does not, and is well structured.

Numerix, btw is not listed either in the Hump or in Gerd's O'Caml
link database.

But you can find it here:

    http://pauillac.inria.fr/~quercia/

There is also a naive libgmp ocaml wrapper:

   http://www.di.ens.fr/~monniaux/download/mlgmp_0.13.tar.gz  

Which *does* contain bindings to the gmp modular exponentiation
functions mpz_powm and mpz_powm_ui.

Cheers,
Julian.