English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2000-07-25 (22:01)
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:


There is also a naive libgmp ocaml wrapper:


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