diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-11-13 05:10:02 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-11-13 05:10:02 +0100 |
commit | 519fa062fa8297fdf871319f81f4179ed7aba63c (patch) | |
tree | 585c8299305bcdab9667cfc423877329f086c1cc /src | |
parent | derp (diff) | |
download | libkeccak-519fa062fa8297fdf871319f81f4179ed7aba63c.tar.gz libkeccak-519fa062fa8297fdf871319f81f4179ed7aba63c.tar.bz2 libkeccak-519fa062fa8297fdf871319f81f4179ed7aba63c.tar.xz |
assume the contents of files are nonsensitive
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libkeccak/files.c | 7 | ||||
-rw-r--r-- | src/libkeccak/files.h | 15 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/libkeccak/files.c b/src/libkeccak/files.c index aa71037..46aea61 100644 --- a/src/libkeccak/files.c +++ b/src/libkeccak/files.c @@ -26,7 +26,8 @@ /** - * Calculate a Keccak-family hashsum of a file + * Calculate a Keccak-family hashsum of a file, + * the content of the file is assumed non-sensitive * * @param fd The file descriptor of the file to hash * @param state The hashing state, should not be initialised (memory leak otherwise) @@ -59,10 +60,10 @@ int libkeccak_generalised_sum_fd(int fd, libkeccak_state_t* restrict state, got = read(fd, chunk, blksize); if (got < 0) return -1; if (got == 0) break; - if (libkeccak_update(state, chunk, (size_t)got) < 0) + if (libkeccak_fast_update(state, chunk, (size_t)got) < 0) return -1; } - return libkeccak_digest(state, NULL, 0, 0, suffix, hashsum); + return libkeccak_fast_digest(state, NULL, 0, 0, suffix, hashsum); } diff --git a/src/libkeccak/files.h b/src/libkeccak/files.h index de63c85..f3279af 100644 --- a/src/libkeccak/files.h +++ b/src/libkeccak/files.h @@ -24,7 +24,8 @@ /** - * Calculate a Keccak-family hashsum of a file + * Calculate a Keccak-family hashsum of a file, + * the content of the file is assumed non-sensitive * * @param fd The file descriptor of the file to hash * @param state The hashing state, should not be initialised (memory leak otherwise) @@ -41,7 +42,8 @@ int libkeccak_generalised_sum_fd(int fd, libkeccak_state_t* restrict state, /** - * Calculate the Keccak hashsum of a file + * Calculate the Keccak hashsum of a file, + * the content of the file is assumed non-sensitive * * @param fd The file descriptor of the file to hash * @param state The hashing state, should not be initialised (memory leak otherwise) @@ -59,7 +61,8 @@ int libkeccak_keccaksum_fd(int fd, libkeccak_state_t* restrict state, /** - * Calculate the SHA3 hashsum of a file + * Calculate the SHA3 hashsum of a file, + * the content of the file is assumed non-sensitive * * @param fd The file descriptor of the file to hash * @param state The hashing state, should not be initialised (memory leak otherwise) @@ -79,7 +82,8 @@ int libkeccak_sha3sum_fd(int fd, libkeccak_state_t* restrict state, /** - * Calculate the RawSHAKE hashsum of a file + * Calculate the RawSHAKE hashsum of a file, + * the content of the file is assumed non-sensitive * * @param fd The file descriptor of the file to hash * @param state The hashing state, should not be initialised (memory leak otherwise) @@ -100,7 +104,8 @@ int libkeccak_rawshakesum_fd(int fd, libkeccak_state_t* restrict state, /** - * Calculate the SHAKE hashsum of a file + * Calculate the SHAKE hashsum of a file, + * the content of the file is assumed non-sensitive * * @param fd The file descriptor of the file to hash * @param state The hashing state, should not be initialised (memory leak otherwise) |