From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p2Q9714R026189 for ; Sat, 26 Mar 2011 10:07:01 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwEAN2rjU1ZELGagWdsb2JhbACERZNtjFJxAQEWJiWIa6kXkFuBJ4NLdwSMdYZ+ X-IronPort-AV: E=Sophos;i="4.63,247,1299452400"; d="scan'208";a="103700176" Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) ([89.16.177.154]) by mail1-smtp-roc.national.inria.fr with SMTP; 26 Mar 2011 10:06:55 +0100 Received: (qmail 738 invoked by uid 634); 26 Mar 2011 09:06:55 -0000 X-Spam-Level: * X-Spam-Check-By: dark.recoil.org Received: from cpc2-cmbg9-0-0-cust410.5-4.cable.virginmedia.com (HELO [192.168.1.107]) (82.16.101.155) (smtp-auth username remote@recoil.org, mechanism cram-md5) by dark.recoil.org (qpsmtpd/0.83) with ESMTPA; Sat, 26 Mar 2011 09:06:54 +0000 References: <201103241651.p2OGpuSK090082@givry.fdupont.fr> In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8C148) Content-Type: text/plain; charset=utf-8 Message-Id: <11DEE1AB-A0A4-4024-97B2-AF46F9CAE433@recoil.org> Cc: Francis Dupont , caml-list X-Mailer: iPhone Mail (8C148) From: Anil Madhavapeddy Date: Sat, 26 Mar 2011 09:06:31 +0000 To: =?utf-8?Q?Jehan_Pag=C3=A8s?= X-Virus-Checked: Checked by ClamAV on dark.recoil.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p2Q9714R026189 Subject: Re: [Caml-list] Ocaml and cryptography 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 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 : >> 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 >