Using libgcrypt on large files

Ralf H gcrypt at kaervek.net
Thu Feb 24 13:20:58 CET 2005


On Thu, 2005-02-24 at 06:37 +0100, Moritz Schulte wrote:
> On Wed, Feb 23, 2005 at 10:41:20PM +0100, Ralf H wrote:
> 
> > 2) What can I do if the file is really large and will not fit into
> > memory? My approach will obviously fail, as I need everything in
> > 'data' :(. Is there a way to hash a file in little portions, so I can
> > read in buffers and update my signatures in a loop?
> 
> No, no: *hash* your file; with gcry_md_*() functions.  And then, sign
> the *hash value* (optionally with pkcs1) - not the file data itself.
> Have a look at the Libgcrypt manual,
> 

Thanks a million, Moritz. That was the push in the right direction I
needed. Everything works like a charm now :)




More information about the Gcrypt-devel mailing list