mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Simplify
This commit is contained in:
@@ -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);
|
sth->acc = gcm_reduce(u);
|
||||||
}
|
}
|
||||||
if (i < ad_len) {
|
if (i < ad_len) {
|
||||||
const size_t n = (ad_len - i) / 16;
|
I256 u = gh_update0(sth, ad + i, st->hx[0]);
|
||||||
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;
|
|
||||||
sth->acc = gcm_reduce(u);
|
sth->acc = gcm_reduce(u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
sth->acc = gcm_reduce(u);
|
||||||
}
|
}
|
||||||
if (i < ad_len) {
|
if (i < ad_len) {
|
||||||
const size_t n = (ad_len - i) / 16;
|
I256 u = gh_update0(sth, ad + i, st->hx[0]);
|
||||||
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;
|
|
||||||
sth->acc = gcm_reduce(u);
|
sth->acc = gcm_reduce(u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user