aboutsummaryrefslogtreecommitdiffstats
path: root/unhex.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-09 20:02:16 +0100
committerMattias Andrée <maandree@kth.se>2019-02-09 20:02:16 +0100
commit9475c19921162986119ee69eba8bfa2a9832d551 (patch)
tree285c9cbd0a824d2bfb480431b33099e2a80e35bf /unhex.c
parentAdd HMAC to TODO (diff)
downloadlibsha2-9475c19921162986119ee69eba8bfa2a9832d551.tar.gz
libsha2-9475c19921162986119ee69eba8bfa2a9832d551.tar.bz2
libsha2-9475c19921162986119ee69eba8bfa2a9832d551.tar.xz
Minor changes, add man pages, rename libsha2_state_initialise to libsha2_init
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'unhex.c')
-rw-r--r--unhex.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/unhex.c b/unhex.c
index 0dc231d..a84ac19 100644
--- a/unhex.c
+++ b/unhex.c
@@ -14,9 +14,10 @@ void
libsha2_unhex(char *restrict output, const char *restrict hashsum)
{
size_t n = strlen(hashsum) / 2;
+ char a, b;
while (n--) {
- char a = hashsum[2 * n + 0];
- char b = hashsum[2 * n + 1];
+ a = hashsum[2 * n + 0];
+ b = hashsum[2 * n + 1];
a = (char)((a & 15) + (a > '9' ? 9 : 0));
b = (char)((b & 15) + (b > '9' ? 9 : 0));