caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: "Jehan Pagès" <jehan.marmottard@gmail.com>
Cc: Francis Dupont <Francis.Dupont@fdupont.fr>,
	caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Ocaml and cryptography
Date: Sat, 26 Mar 2011 09:06:31 +0000	[thread overview]
Message-ID: <11DEE1AB-A0A4-4024-97B2-AF46F9CAE433@recoil.org> (raw)
In-Reply-To: <AANLkTimg4Q6rucJjfKjgtLiLo2NX-oRLEGFXGv+h7VDd@mail.gmail.com>

OpenSSL may also be using direct hardware instructions to speed up SHA1/AES, rather doing the work itself. Check out the AES-NI in newer Intel chips, or Padlock SHA1 in Via chips.

This is quite handy, since it means you can also use them to speed up your library on modern chips, but fall back to a reasonably performant implementation if it's not available (without ever having to bind to the rather gnarly OpenSSL monster).

Anil

On 26 Mar 2011, at 06:47, Jehan Pagès <jehan.marmottard@gmail.com> wrote:

> Hi,
> 
> I see. Indeed I checked OpenSSL, it is using massively assembly code
> for SHA1 and many other (all?) crypto code...
> 
> And my tests on a 64 bits machine and the huge improvement for OpenSSL
> there makes me think that they must be making very good use of the 64
> bits register for saving the 32 bits words of SHA1 algorithm (they
> probably make some calculation on 2 words at once thanks to this).
> 
> Jehan
> 
> 2011/3/25 Francis Dupont <Francis.Dupont@fdupont.fr>:
>> This is not the first study about crypto implementation speeds.
>> Usually the winner for heavily used algorithms is OpenSSL,
>> BTW not because it is well written but simply because it is
>> optmized in assembly for common platforms (including SSE* & co
>> on x86).
>> 
>> Regards
>> 
>> Francis.Dupont@fdupont.fr
>> 
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 


  reply	other threads:[~2011-03-26  9:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 12:17 Jehan Pagès
2011-03-24 13:26 ` Gerd Stolpmann
2011-03-26  6:44   ` Jehan Pagès
2011-03-28 19:13     ` Gerd Stolpmann
2011-03-24 16:51 ` Francis Dupont
2011-03-26  6:47   ` Jehan Pagès
2011-03-26  9:06     ` Anil Madhavapeddy [this message]
2011-03-26 11:53       ` Jehan Pagès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11DEE1AB-A0A4-4024-97B2-AF46F9CAE433@recoil.org \
    --to=anil@recoil.org \
    --cc=Francis.Dupont@fdupont.fr \
    --cc=caml-list@inria.fr \
    --cc=jehan.marmottard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).