aboutsummaryrefslogtreecommitdiffstats
path: root/sum_fd.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-09 21:07:38 +0100
committerMattias Andrée <maandree@kth.se>2019-02-09 21:08:16 +0100
commita265d4c4c790c442af8760345bcade8181f5d1a4 (patch)
tree591fbb1134a690d8b9f17b3ae939d9da18f2c776 /sum_fd.c
parentAdd marshal and unmarshal functions (diff)
downloadlibsha2-a265d4c4c790c442af8760345bcade8181f5d1a4.tar.gz
libsha2-a265d4c4c790c442af8760345bcade8181f5d1a4.tar.bz2
libsha2-a265d4c4c790c442af8760345bcade8181f5d1a4.tar.xz
Fix documentation about lengths (in bits, not bytes) and fix libsha2_sum_fd (lengths are in bits)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'sum_fd.c')
-rw-r--r--sum_fd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sum_fd.c b/sum_fd.c
index 35d4121..888e423 100644
--- a/sum_fd.c
+++ b/sum_fd.c
@@ -37,10 +37,9 @@ libsha2_sum_fd(int fd, enum libsha2_algorithm algorithm, char *restrict hashsum)
continue;
return -1;
}
- libsha2_update(&state, chunk, (size_t)r);
+ libsha2_update(&state, chunk, (size_t)r * 8);
}
libsha2_digest(&state, NULL, 0, hashsum);
return 0;
}
-