diff options
author | Linus Nordberg <linus@nordu.net> | 2011-04-05 15:50:59 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2011-04-05 15:50:59 +0200 |
commit | 1c114bfcb18c98b12182dc9f1d1e6d8eb6127d94 (patch) | |
tree | 6a734e9636b892ddf2c78d80c1d43cd49a781775 | |
parent | 5042a29c4e80ca97fa51122954079d7d169037e9 (diff) |
Produce full length F-Tick MAC hashes for FullyHashed and FullyKeyHashed.
We produced 62 octets rather than 64.
-rw-r--r-- | fticks.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -19,10 +19,10 @@ static void format_hash(const uint8_t *hash, size_t out_len, uint8_t *out) { - int i; + int ir, iw; - for (i = 0; i < out_len / 2 - 1; i++) - sprintf((char *) out + i*2, "%02x", hash[i % SHA256_DIGEST_SIZE]); + for (ir = 0, iw = 0; iw <= out_len - 3; ir++, iw += 2) + sprintf((char *) out + iw, "%02x", hash[ir % SHA256_DIGEST_SIZE]); } static void |