1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00
This commit is contained in:
Frank Denis 2022-11-16 13:25:00 +01:00
parent 6a81ad2b25
commit 3105de25da
2 changed files with 2 additions and 16 deletions

View File

@ -358,14 +358,7 @@ gh_ad_blocks(const State *st, GHash *sth, const unsigned char *ad, size_t ad_len
sth->acc = gcm_reduce(u);
}
if (i < ad_len) {
const size_t n = (ad_len - i) / 16;
I256 u = gh_update0(sth, ad + i, st->hx[n - 1 - 0]);
size_t j;
for (j = 1; j < n; j += 1) {
gh_update(&u, ad + i + j * 16, st->hx[n - 1 - j]);
}
i += n * 16;
I256 u = gh_update0(sth, ad + i, st->hx[0]);
sth->acc = gcm_reduce(u);
}
}

View File

@ -372,14 +372,7 @@ gh_ad_blocks(const State *st, GHash *sth, const unsigned char *ad, size_t ad_len
sth->acc = gcm_reduce(u);
}
if (i < ad_len) {
const size_t n = (ad_len - i) / 16;
I256 u = gh_update0(sth, ad + i, st->hx[n - 1 - 0]);
size_t j;
for (j = 1; j < n; j += 1) {
gh_update(&u, ad + i + j * 16, st->hx[n - 1 - j]);
}
i += n * 16;
I256 u = gh_update0(sth, ad + i, st->hx[0]);
sth->acc = gcm_reduce(u);
}
}