diff options
author | Mattias Andrée <maandree@kth.se> | 2020-06-10 17:14:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 17:14:39 +0200 |
commit | 3d72bb0e3fda83cf6577ea9cf2f890f3fd8737c5 (patch) | |
tree | 3ef7c38d45b150b4005391907815c9ff2eb75586 /libkeccak_generalised_sum_fd.c | |
parent | Deprecate libkeccak_{state,hmac}_{unmarshal_skip,marshal_size} and replace with the functions without the _skip or _size suffix (diff) | |
parent | support WIN32 (diff) | |
download | libkeccak-3d72bb0e3fda83cf6577ea9cf2f890f3fd8737c5.tar.gz libkeccak-3d72bb0e3fda83cf6577ea9cf2f890f3fd8737c5.tar.bz2 libkeccak-3d72bb0e3fda83cf6577ea9cf2f890f3fd8737c5.tar.xz |
Merge pull request #12 from hackmod/win32
minimal WIN32 support added
Diffstat (limited to '')
-rw-r--r-- | libkeccak_generalised_sum_fd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libkeccak_generalised_sum_fd.c b/libkeccak_generalised_sum_fd.c index 7c4df54..879371b 100644 --- a/libkeccak_generalised_sum_fd.c +++ b/libkeccak_generalised_sum_fd.c @@ -19,16 +19,20 @@ libkeccak_generalised_sum_fd(int fd, struct libkeccak_state *restrict state, con const char *restrict suffix, void *restrict hashsum) { ssize_t got; +#ifndef _WIN32 struct stat attr; +#endif size_t blksize = 4096; void *restrict chunk; if (libkeccak_state_initialise(state, spec) < 0) return -1; +#ifndef _WIN32 if (fstat(fd, &attr) == 0) if (attr.st_blksize > 0) blksize = (size_t)attr.st_blksize; +#endif chunk = alloca(blksize); |