David Craven <da...@craven.ch> skribis:

>> Also, why is sha256 used via FFI via an external library? It's not exactly 
>> 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-r5rs-of-sha256

I suspect it would be slow with Guile 2.0, and (guix hash) is used in
performance-critical locations.

That said, if there’s a need for it on the build side where performance
does not matter much, it makes sense to add a pure-Scheme
implementation.  I think Weinhölt’s Industria library has one.

Alternately, we could make it easier to import (guix hash).  All we need
is to create a custom (guix config) module where ‘%libgcrypt’ is found
to the right thing, or something like that.

HTH!

Ludo’.

Reply via email to