From 883db95da2d4dad540d82b17a4054b99840dd798 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 30 Mar 2017 22:19:49 +0200 Subject: [PATCH] FILE_READ_BUFSIZE > LTC_FILE_READ_BUFSIZE --- src/headers/tomcrypt_custom.h | 4 +++- src/mac/poly1305/poly1305_file.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 61eafd23..bfe1f7bb 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -552,7 +552,9 @@ #ifndef LTC_NO_FILE /* buffer size for reading from a file via fread(..) */ - #define FILE_READ_BUFSIZE 8192 + #ifndef LTC_FILE_READ_BUFSIZE + #define LTC_FILE_READ_BUFSIZE 8192 + #endif #endif /* $Source$ */ diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index bca5ceb5..02f2c43d 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -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(FILE_READ_BUFSIZE)) == NULL) { return CRYPT_MEM; } + if ((buf = XMALLOC(LTC_FILE_READ_BUFSIZE)) == NULL) { return CRYPT_MEM; } if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } do {