提交 4b904301 编写于 作者: A Andy Polyakov

sha/keccak1600.c: add couple of soft asserts.

Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 ca1574ce
......@@ -167,6 +167,8 @@ size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
uint64_t *A_flat = (uint64_t *)A;
size_t i, w = r / 8;
assert(r < (25 * sizeof(A[0][0])) && (r % 8) == 0);
while (len >= r) {
for (i = 0; i < w; i++) {
A_flat[i] ^= (uint64_t)inp[0] | (uint64_t)inp[1] << 8 |
......@@ -191,6 +193,8 @@ void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r)
uint64_t *A_flat = (uint64_t *)A;
size_t i, rem, w = r / 8;
assert(r < (25 * sizeof(A[0][0])) && (r % 8) == 0);
while (len >= r) {
for (i = 0; i < w; i++) {
uint64_t Ai = A_flat[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册