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 p2QBraEh031388 for ; Sat, 26 Mar 2011 12:53:36 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai8CAITSjU1KfVK2kGdsb2JhbACYMo0nCBQBAQEBCQkNBxQEIYhrnySKVIIhhGUviFwBAQMFhWQEhTiHPYZ+ggw6 X-IronPort-AV: E=Sophos;i="4.63,247,1299452400"; d="scan'208";a="103723009" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 26 Mar 2011 12:53:30 +0100 Received: by wyf23 with SMTP id 23so2761906wyf.27 for ; Sat, 26 Mar 2011 04:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=AJRC8PACFc7DGyHXnCrGgJK+9MHBAvljZjMKNuQV+7o=; b=LDbA9hNxbdp6+GyMScgm/Xg4TF8EXMypDj4/eseeV5L4AFBKOb0SiDINj9jtsEpuJK SgShZHwESWoE6uYpBghZQ3KqvFRRU0jutxvkB/wbhgMcgw9JaVvgMKifouB1YeV95Io2 3DTUmlTSymk4EuTzWW3rSNs3ipCIcMdwwwBls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tex0d9W/rmy6ztIeAuJcaw4ZGQOaE+I5hAUsbJpzkfZmIGF3BZsIfFzREueQqang5e mJ9B6HVNnXDzYTbPudzO4kARgwV8Fh1KH/X+dSg36iZzkdBNOf2gnwfC/Xs8i/MKr+Kw wTYSTdIblgYcUHudIJBQsVvk6epVjMoXiclXc= MIME-Version: 1.0 Received: by 10.216.121.130 with SMTP id r2mr1688589weh.96.1301140410413; Sat, 26 Mar 2011 04:53:30 -0700 (PDT) Received: by 10.216.246.69 with HTTP; Sat, 26 Mar 2011 04:53:30 -0700 (PDT) In-Reply-To: <11DEE1AB-A0A4-4024-97B2-AF46F9CAE433@recoil.org> References: <201103241651.p2OGpuSK090082@givry.fdupont.fr> <11DEE1AB-A0A4-4024-97B2-AF46F9CAE433@recoil.org> Date: Sat, 26 Mar 2011 20:53:30 +0900 Message-ID: From: =?ISO-8859-1?Q?Jehan_Pag=E8s?= To: Anil Madhavapeddy Cc: Francis Dupont , caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p2QBraEh031388 Subject: Re: [Caml-list] Ocaml and cryptography Hi, 2011/3/26 Anil Madhavapeddy : > 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). > That's very interesting. If I had such a material, I would improve my library to support any of them, just for the fun of doing so and testing the difference. Plus that must be interesting to see how from Ocaml I can access this kind of material. Unfortunately I don't (have). Jehan > 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 >> >