new #define FILE_READ_BUFSIZE

This commit is contained in:
Karel Miko 2017-03-30 21:23:20 +02:00
parent ff5b02d371
commit 06b1582de6
2 changed files with 5 additions and 2 deletions

View File

@ -550,7 +550,10 @@
#endif
#ifndef LTC_NO_FILE
/* buffer size for reading from a file via fread(..) */
#define FILE_READ_BUFSIZE 8192
#endif
/* $Source$ */
/* $Revision$ */

View File

@ -42,7 +42,7 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key
LTC_ARGCHK(maclen != NULL);
if ((in = fopen(fname, "rb")) == NULL) { return CRYPT_FILE_NOTFOUND; }
if ((buf = XMALLOC(8196)) == NULL) { return CRYPT_MEM; }
if ((buf = XMALLOC(FILE_READ_BUFSIZE)) == NULL) { return CRYPT_MEM; }
if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; }
do {