diff options
author | Mattias Andrée <maandree@kth.se> | 2022-02-16 22:18:10 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-02-16 22:18:10 +0100 |
commit | fcf392fa6ce0edce07ac8263194619b68be6552a (patch) | |
tree | 354717b754eb8559803472e6859d9f217ec8c911 /libar2_hash.c | |
parent | Add more tests (diff) | |
download | libar2-fcf392fa6ce0edce07ac8263194619b68be6552a.tar.gz libar2-fcf392fa6ce0edce07ac8263194619b68be6552a.tar.bz2 libar2-fcf392fa6ce0edce07ac8263194619b68be6552a.tar.xz |
Add more tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libar2_hash.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libar2_hash.c b/libar2_hash.c index 9d629f6..49bf61a 100644 --- a/libar2_hash.c +++ b/libar2_hash.c @@ -423,8 +423,11 @@ initial_hash(unsigned char hash[static 64], void *msg, size_t msglen, } if (n == 0) { off += libblake_blake2b_update(&state, SEGMENT(params->ad, params->adlen, off)); - if (params->adlen - off > 128) + if (params->adlen - off > 128) { + /* $covered{$ (not really possible, but just to be safe) */ off += libblake_blake2b_force_update(&state, SEGMENT(params->ad, params->adlen, off)); + /* $covered}$ */ + } memcpy(block, SEGMENT(params->ad, params->adlen, off)); n = params->adlen - off; } |