diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-09 20:02:16 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-09 20:02:16 +0100 |
commit | 9475c19921162986119ee69eba8bfa2a9832d551 (patch) | |
tree | 285c9cbd0a824d2bfb480431b33099e2a80e35bf /unhex.c | |
parent | Add HMAC to TODO (diff) | |
download | libsha2-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)); |