From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C8182BC57 for ; Thu, 22 Jul 2010 10:37:43 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0CAAugR0zZSMDdkGdsb2JhbACTB4xvFQEBAQEJCQwHEQMfwGqFNgQ X-IronPort-AV: E=Sophos;i="4.55,242,1278280800"; d="scan'208";a="66796891" Received: from fmmailgate01.web.de ([217.72.192.221]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Jul 2010 10:37:43 +0200 Received: from smtp07.web.de ( [172.20.5.215]) by fmmailgate01.web.de (Postfix) with ESMTP id C56EF164B84FF; Thu, 22 Jul 2010 10:37:42 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1ObrHi-0003SM-00; Thu, 22 Jul 2010 10:37:42 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.72) (envelope-from ) id 1ObrHi-0003tR-7d; Thu, 22 Jul 2010 10:37:42 +0200 From: Goswin von Brederlow To: Dario Teixeira Cc: caml-list@inria.fr, Sylvain Le Gall Subject: Re: [Caml-list] Re: Cryptokit and HMAC-SHA256 References: <317672.81389.qm@web111509.mail.gq1.yahoo.com> Date: Thu, 22 Jul 2010 10:37:42 +0200 In-Reply-To: <317672.81389.qm@web111509.mail.gq1.yahoo.com> (Dario Teixeira's message of "Wed, 21 Jul 2010 14:22:58 -0700 (PDT)") Message-ID: <87vd87ykrt.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1+fXIFyenG4MRw8Qnl4I0WsyLFfTOVzDiKyeCY4 p4hULBtn7Mg916+2OZ4548K6S54bt4OR/KfpgcrktAhRraMPbv nv08zcH0Q= X-Spam: no; 0.00; cheers:01 patching:01 bigarrays:01 bigarray:01 4231:98 mfg:98 cryptokit:01 cryptokit:01 heap:01 caml-list:01 functions:01 writes:01 data:02 data:02 allocated:02 Dario Teixeira writes: > Hi, > >> If you decide to code the solution and provide the patch, I will be >> happy to apply it to cryptokit (if the main author of cryptokit accepts >> it, of course). > > I'm attaching the patches adding support for HMAC-SHA256 and HMAC-RIPEMD160 > (I don't need the latter, but for the sake of completeness it seemed silly > not to support it as well). Note that these are *very* straightforward > patches -- kudos to Xavier for making Cryptokit so easy to extend. > > The caveat is that I'm not a cryptographer. I did, however, verify that > these new HMACs pass all the test cases listed in RFC4231 (for HMAC-SHA256) > and RFC2286 (for HMAC-RIPEMD160). > > Thanks for your attention! > Cheers, > Dario Teixeira While you are patching cryptokit anyway would it be possible to also add functions to work on Bigarrays? One huge advantage of bigarray is that the data region is allocated outside the GC heap and will never move. That means one can use enter_blocking_section() / leave_blocking_section() while calculating the checksum for a block of data. For multithreaded applications that can speed up the program by the number of cores present. MfG Goswin