GMP vs BigNum

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

GMP vs BigNum

rz1a
Hello openssl-dev,

  Did anyone attepmpt a comparison of the speed in the GMP vs BN?
  Maintainer of GMP (Torbjorn Granlund) says that his tests show 2~3
  times better speed with GMP. Can anyone validate this?
  If this is indeed the case - why OpenSSL does not use GMP?

--
Best regards,
 Tony                   mailto:[hidden email]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: GMP vs BigNum

Jack Lloyd

I am not an OpenSSL developer, but I think I can safely comment
on this based on my own experience. First, GNU MP is another
dependency, and last I checked GNU MP does not run very well or
at all on a number of important platforms. And of course there is
always the NIY syndrome at work. OpenSSL does actually support
GNU MP, as an engine, which means it can be used if available,
and if not, OpenSSL still works fine.

I have implemented backends to both OpenSSL's BN and to GNU MP
for my own crypto library, as both of them are noticably faster
than my own BN code. :) I found RSA/DSA/DH speeds to be about
1.5x-2x as fast with GNU MP as compared to OpenSSL's BN. However,
that is not the complete picture, as Botan does not use OpenSSL's
higher level operations (for example the RSA calls), but rather
implements things by direct calls to BN. Thus, it skips any
interesting algorithm-specific optimizations which might be made
in OpenSSL, though in benchmarks I found Botan w/BN engine to be
nearly exactly as fast as what is reported by OpenSSL's `speed`
program [*], suggesting that any optimizations that are there are
not of any major consequence.

[*] With small keysizes there seems to be some per-call overhead
which comes into account, which is not surprising; Botan w/BN's
512-bit public key RSA operations are only about 2/3 as fast as
OpenSSL, but for slower private operations, or with larger keys,
Botan w/BN and OpenSSL run within 5% of each other.

Hope this helps answer your question.

-Jack

On Wed, Aug 10, 2005 at 07:55:06PM +0400, [hidden email] wrote:

> Hello openssl-dev,
>
>   Did anyone attepmpt a comparison of the speed in the GMP vs BN?
>   Maintainer of GMP (Torbjorn Granlund) says that his tests show 2~3
>   times better speed with GMP. Can anyone validate this?
>   If this is indeed the case - why OpenSSL does not use GMP?
>
> --
> Best regards,
>  Tony                   mailto:[hidden email]
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [hidden email]
> Automated List Manager                           [hidden email]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re[2]: GMP vs BigNum

rz1a
Hello Jack,

Wednesday, August 10, 2005, 8:29:26 PM, you wrote:
JL> OpenSSL does actually support GNU MP, as an engine, which means it
JL> can be used if available, and if not, OpenSSL still works fine.
I do have GMP v4.1.4 ported, how to tell OpenSSL 0.9.8 to use it?

Tony.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: GMP vs BigNum

Jim Schneider-2
In reply to this post by rz1a
I suspect the reasons are political and legal, rather than practical.  The
first version of GMP was released under the full GPL (the Free Software
Foundation's General Public License), which is not compatible with the
license for SSLeay (the project that evolved into OpenSSL).

The first version of GMP available under the LGPL (which may be compatible
with the SSLeay license, but I'm not sure) was 2.0, which was released in
April of 1996, after the first public release of SSLeay (I'm not sure exactly
when, but I have SSLeay documentation that dates to February of 1996).

On Wednesday 10 August 2005 11:55, [hidden email] wrote:
> Hello openssl-dev,
>
>   Did anyone attepmpt a comparison of the speed in the GMP vs BN?
>   Maintainer of GMP (Torbjorn Granlund) says that his tests show 2~3
>   times better speed with GMP. Can anyone validate this?
>   If this is indeed the case - why OpenSSL does not use GMP?

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: GMP vs BigNum

prakash babu
In reply to this post by rz1a
Hi Tony,
 
1. Build OpenSSL with an additional configure option "DOPENSSL_USE_GMP  -lgmp"
2. This will build an engine for gmp
3. Use the switch -engine gmp to make use of this engine at command line
 
--Prakash

[hidden email] wrote:

Hello Jack,

Wednesday, August 10, 2005, 8:29:26 PM, you wrote:
JL> OpenSSL does actually support GNU MP, as an engine, which means it
JL> can be used if available, and if not, OpenSSL still works fine.
I do have GMP v4.1.4 ported, how to tell OpenSSL 0.9.8 to use it?

Tony.


______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [hidden email]
Automated List Manager [hidden email]


Start your day with Yahoo! - make it your home page