On 04/25/2018 01:26 PM, Matteo Croce wrote: > +#define BLOCKSIZE 32768 Did you try different buffer sizes?
In coreutils, we have a little script to determine the optimal BLOCKSIZE - which is 128*1024 since 2014: https://git.sv.gnu.org/cgit/coreutils.git/tree/src/ioblksize.h?id=22424dde74d0 > +#ifdef AF_ALG > + int ret; > + > + ret = afalg_stream(stream, resblock, "sha1", SHA1_DIGEST_SIZE); > + if (!ret) > + return 0; > + > + if (ret == -EIO) > + return 1; > +#endif afalg_stream also returns other errors, namely EAFNOSUPPORT and EINVAL, which should be handled as well, right? Thanks & have a nice day, Berny