From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Craven Subject: Re: Guix build side - including modules (guix hash), (guix gcrypt): How to provide shared library? Date: Mon, 2 Jan 2017 15:31:31 +0100 Message-ID: References: <20170102031618.731a77b0@scratchpost.org> <20170102145137.41830372@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cO3eA-0003E7-PF for guix-devel@gnu.org; Mon, 02 Jan 2017 09:31:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cO3e8-0007wb-7T for guix-devel@gnu.org; Mon, 02 Jan 2017 09:31:34 -0500 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:34059) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cO3e8-0007wT-2t for guix-devel@gnu.org; Mon, 02 Jan 2017 09:31:32 -0500 Received: by mail-qk0-x22a.google.com with SMTP id h201so212140673qke.1 for ; Mon, 02 Jan 2017 06:31:32 -0800 (PST) In-Reply-To: <20170102145137.41830372@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel I find it useful to look at the generated drv (/gnu/store/asr76labrpqq0kcg64yni0sqsxj0d30y-rust-gtk-0.1.1.drv) and build script (/gnu/store/hash-rust-gtk-0.1.1.builder) and see if those make sense. Sounds like a hard problem dough. Good luck! :) I notice you haven't rebased yet, I added a couple of commits to the cargo-build-system yesterday... > Also, why is sha256 used via FFI via an external library? It's not exactl= y difficult to implement in Guile :P I'm not sure we want to write our own crypto primitives... And it's not quite as trivial, I don't know or care what a Newton-Raphson algorithm is ;) http://stackoverflow.com/questions/24093199/a-pure-scheme-implementation-r5= rs-of-sha256 > @dfeuer Not for the purposes of deriving the SHA-2 initialisation values= . Most implementations use IEEE-754 doubles, which have only 53 bits of sig= nificand, not nearly enough for the 64-bit values used in the constants. I = basically convert the doubles to rationals, then use Newton-Raphson to get = the extra precision necessary. =E2=80=93 Chris Jester-Young Jun 19 '14 at 6= :10 > @dfeuer And now, on Mark Weaver's suggestion, I don't even use doubles at= all, but instead use pure Newton-Raphson. It does make the startup slower,= but that's a one-time cost. =E2=80=93 Chris Jester-Young Aug 12 '14 at 15:= 26