1
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
3
* LibTomCrypt is a library that provides various cryptographic
4
* algorithms in a highly modular and flexible manner.
6
* The library is free for all purposes without any express
9
* Tom St Denis, tomstdenis@iahu.ca, http://libtomcrypt.org
13
int hash_file(int hash, const char *fname, unsigned char *dst, unsigned long *outlen)
20
_ARGCHK(fname != NULL);
22
_ARGCHK(outlen != NULL);
24
if ((err = hash_is_valid(hash)) != CRYPT_OK) {
28
in = fopen(fname, "rb");
30
return CRYPT_FILE_NOTFOUND;
33
err = hash_filehandle(hash, in, dst, outlen);
34
if (fclose(in) != 0) {