1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 15:39:07 +00:00
This commit is contained in:
John M. Schanck 2020-09-17 11:54:58 -04:00 committed by Kris Kwiatkowski
parent 1ba4f503a7
commit ff16fec435
29 changed files with 93 additions and 57 deletions

View File

@ -445,7 +445,7 @@ PQCLEAN_FALCON1024_CLEAN_comp_decode(
} }
x[u] = (int16_t) m; x[u] = (int16_t) m;
if (s) { if (s) {
x[u] = (int16_t) -x[u]; x[u] = (int16_t) - x[u];
} }
} }
return v; return v;

View File

@ -436,8 +436,8 @@ fpr_lt(fpr x, fpr y) {
*/ */
int cc0, cc1; int cc0, cc1;
cc0 = (int)((*(int64_t *)&x - *(int64_t *)&y) >> 63) & 1; cc0 = (int)((*(int64_t *)&x - * (int64_t *)&y) >> 63) & 1;
cc1 = (int)((*(int64_t *)&y - *(int64_t *)&x) >> 63) & 1; cc1 = (int)((*(int64_t *)&y - * (int64_t *)&x) >> 63) & 1;
return cc0 ^ ((cc0 ^ cc1) & (int)((x & y) >> 63)); return cc0 ^ ((cc0 ^ cc1) & (int)((x & y) >> 63));
} }

View File

@ -2656,16 +2656,18 @@ make_fg(uint32_t *data, const int8_t *f, const int8_t *g,
return; return;
} }
if (depth == 0) return; if (depth == 0) {
return;
}
if (depth == 1) { if (depth == 1) {
make_fg_step(data, logn, 0, 0, out_ntt); make_fg_step(data, logn, 0, 0, out_ntt);
return; return;
} }
make_fg_step(data, logn, 0, 0, 1); make_fg_step(data, logn, 0, 0, 1);
for (d = 1; d+1 < depth; d ++) { for (d = 1; d + 1 < depth; d ++) {
make_fg_step(data, logn - d, d, 1, 1); make_fg_step(data, logn - d, d, 1, 1);
} }
make_fg_step(data, logn-depth+1, depth-1, 1, out_ntt); make_fg_step(data, logn - depth + 1, depth - 1, 1, out_ntt);
} }
/* /*
@ -3043,7 +3045,9 @@ solve_NTRU_intermediate(unsigned logn_top,
* middle or the upper half of these top 10 words. * middle or the upper half of these top 10 words.
*/ */
rlen = slen; rlen = slen;
if (rlen > 10) rlen = 10; if (rlen > 10) {
rlen = 10;
}
poly_big_to_fp(rt3, ft + slen - rlen, rlen, slen, logn); poly_big_to_fp(rt3, ft + slen - rlen, rlen, slen, logn);
poly_big_to_fp(rt4, gt + slen - rlen, rlen, slen, logn); poly_big_to_fp(rt4, gt + slen - rlen, rlen, slen, logn);
@ -3118,7 +3122,9 @@ solve_NTRU_intermediate(unsigned logn_top,
* scaling if the current length is more than 10 words. * scaling if the current length is more than 10 words.
*/ */
rlen = FGlen; rlen = FGlen;
if (rlen > 10) rlen = 10; if (rlen > 10) {
rlen = 10;
}
scale_FG = 31 * (int)(FGlen - rlen); scale_FG = 31 * (int)(FGlen - rlen);
poly_big_to_fp(rt1, Ft + FGlen - rlen, rlen, llen, logn); poly_big_to_fp(rt1, Ft + FGlen - rlen, rlen, llen, logn);
poly_big_to_fp(rt2, Gt + FGlen - rlen, rlen, llen, logn); poly_big_to_fp(rt2, Gt + FGlen - rlen, rlen, llen, logn);

View File

@ -445,7 +445,7 @@ PQCLEAN_FALCON512_CLEAN_comp_decode(
} }
x[u] = (int16_t) m; x[u] = (int16_t) m;
if (s) { if (s) {
x[u] = (int16_t) -x[u]; x[u] = (int16_t) - x[u];
} }
} }
return v; return v;

View File

@ -436,8 +436,8 @@ fpr_lt(fpr x, fpr y) {
*/ */
int cc0, cc1; int cc0, cc1;
cc0 = (int)((*(int64_t *)&x - *(int64_t *)&y) >> 63) & 1; cc0 = (int)((*(int64_t *)&x - * (int64_t *)&y) >> 63) & 1;
cc1 = (int)((*(int64_t *)&y - *(int64_t *)&x) >> 63) & 1; cc1 = (int)((*(int64_t *)&y - * (int64_t *)&x) >> 63) & 1;
return cc0 ^ ((cc0 ^ cc1) & (int)((x & y) >> 63)); return cc0 ^ ((cc0 ^ cc1) & (int)((x & y) >> 63));
} }

View File

@ -2656,16 +2656,18 @@ make_fg(uint32_t *data, const int8_t *f, const int8_t *g,
return; return;
} }
if (depth == 0) return; if (depth == 0) {
return;
}
if (depth == 1) { if (depth == 1) {
make_fg_step(data, logn, 0, 0, out_ntt); make_fg_step(data, logn, 0, 0, out_ntt);
return; return;
} }
make_fg_step(data, logn, 0, 0, 1); make_fg_step(data, logn, 0, 0, 1);
for (d = 1; d+1 < depth; d ++) { for (d = 1; d + 1 < depth; d ++) {
make_fg_step(data, logn - d, d, 1, 1); make_fg_step(data, logn - d, d, 1, 1);
} }
make_fg_step(data, logn-depth+1, depth-1, 1, out_ntt); make_fg_step(data, logn - depth + 1, depth - 1, 1, out_ntt);
} }
/* /*
@ -3043,7 +3045,9 @@ solve_NTRU_intermediate(unsigned logn_top,
* middle or the upper half of these top 10 words. * middle or the upper half of these top 10 words.
*/ */
rlen = slen; rlen = slen;
if (rlen > 10) rlen = 10; if (rlen > 10) {
rlen = 10;
}
poly_big_to_fp(rt3, ft + slen - rlen, rlen, slen, logn); poly_big_to_fp(rt3, ft + slen - rlen, rlen, slen, logn);
poly_big_to_fp(rt4, gt + slen - rlen, rlen, slen, logn); poly_big_to_fp(rt4, gt + slen - rlen, rlen, slen, logn);
@ -3118,7 +3122,9 @@ solve_NTRU_intermediate(unsigned logn_top,
* scaling if the current length is more than 10 words. * scaling if the current length is more than 10 words.
*/ */
rlen = FGlen; rlen = FGlen;
if (rlen > 10) rlen = 10; if (rlen > 10) {
rlen = 10;
}
scale_FG = 31 * (int)(FGlen - rlen); scale_FG = 31 * (int)(FGlen - rlen);
poly_big_to_fp(rt1, Ft + FGlen - rlen, rlen, llen, logn); poly_big_to_fp(rt1, Ft + FGlen - rlen, rlen, llen, logn);
poly_big_to_fp(rt2, Gt + FGlen - rlen, rlen, llen, logn); poly_big_to_fp(rt2, Gt + FGlen - rlen, rlen, llen, logn);

View File

@ -72,7 +72,7 @@ static unsigned int gf256mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsign
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + w * j; uint8_t *aj = mat + w * j;
PQCLEAN_RAINBOWIIICCLASSIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1^PQCLEAN_RAINBOWIIICCLASSIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4); PQCLEAN_RAINBOWIIICCLASSIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1 ^ PQCLEAN_RAINBOWIIICCLASSIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4);
} }
r8 &= PQCLEAN_RAINBOWIIICCLASSIC_CLEAN_gf256_is_nonzero(ai[i]); r8 &= PQCLEAN_RAINBOWIIICCLASSIC_CLEAN_gf256_is_nonzero(ai[i]);
uint8_t pivot = ai[i]; uint8_t pivot = ai[i];

View File

@ -72,7 +72,7 @@ static unsigned int gf256mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsign
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + w * j; uint8_t *aj = mat + w * j;
PQCLEAN_RAINBOWIIICCYCLICCOMPRESSED_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1^PQCLEAN_RAINBOWIIICCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4); PQCLEAN_RAINBOWIIICCYCLICCOMPRESSED_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1 ^ PQCLEAN_RAINBOWIIICCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4);
} }
r8 &= PQCLEAN_RAINBOWIIICCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]); r8 &= PQCLEAN_RAINBOWIIICCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]);
uint8_t pivot = ai[i]; uint8_t pivot = ai[i];

View File

@ -72,7 +72,7 @@ static unsigned int gf256mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsign
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + w * j; uint8_t *aj = mat + w * j;
PQCLEAN_RAINBOWIIICCYCLIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1^PQCLEAN_RAINBOWIIICCYCLIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4); PQCLEAN_RAINBOWIIICCYCLIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1 ^ PQCLEAN_RAINBOWIIICCYCLIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4);
} }
r8 &= PQCLEAN_RAINBOWIIICCYCLIC_CLEAN_gf256_is_nonzero(ai[i]); r8 &= PQCLEAN_RAINBOWIIICCYCLIC_CLEAN_gf256_is_nonzero(ai[i]);
uint8_t pivot = ai[i]; uint8_t pivot = ai[i];

View File

@ -74,7 +74,7 @@ static unsigned int gf16mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsigne
uint8_t *ai = mat + n_w_byte * i; uint8_t *ai = mat + n_w_byte * i;
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + n_w_byte * j; uint8_t *aj = mat + n_w_byte * j;
PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf256v_predicated_add(ai + offset_byte, 1^PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16_is_nonzero(PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16v_get_ele(ai, i)), aj + offset_byte, n_w_byte - offset_byte); PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf256v_predicated_add(ai + offset_byte, 1 ^ PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16_is_nonzero(PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16v_get_ele(ai, i)), aj + offset_byte, n_w_byte - offset_byte);
} }
uint8_t pivot = PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16v_get_ele(ai, i); uint8_t pivot = PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16v_get_ele(ai, i);
r8 &= PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16_is_nonzero(pivot); r8 &= PQCLEAN_RAINBOWIACLASSIC_CLEAN_gf16_is_nonzero(pivot);

View File

@ -74,7 +74,7 @@ static unsigned int gf16mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsigne
uint8_t *ai = mat + n_w_byte * i; uint8_t *ai = mat + n_w_byte * i;
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + n_w_byte * j; uint8_t *aj = mat + n_w_byte * j;
PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf256v_predicated_add(ai + offset_byte, 1^PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16_is_nonzero(PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16v_get_ele(ai, i)), aj + offset_byte, n_w_byte - offset_byte); PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf256v_predicated_add(ai + offset_byte, 1 ^ PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16_is_nonzero(PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16v_get_ele(ai, i)), aj + offset_byte, n_w_byte - offset_byte);
} }
uint8_t pivot = PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16v_get_ele(ai, i); uint8_t pivot = PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16v_get_ele(ai, i);
r8 &= PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16_is_nonzero(pivot); r8 &= PQCLEAN_RAINBOWIACYCLICCOMPRESSED_CLEAN_gf16_is_nonzero(pivot);

View File

@ -74,7 +74,7 @@ static unsigned int gf16mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsigne
uint8_t *ai = mat + n_w_byte * i; uint8_t *ai = mat + n_w_byte * i;
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + n_w_byte * j; uint8_t *aj = mat + n_w_byte * j;
PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf256v_predicated_add(ai + offset_byte, 1^PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16_is_nonzero(PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16v_get_ele(ai, i)), aj + offset_byte, n_w_byte - offset_byte); PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf256v_predicated_add(ai + offset_byte, 1 ^ PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16_is_nonzero(PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16v_get_ele(ai, i)), aj + offset_byte, n_w_byte - offset_byte);
} }
uint8_t pivot = PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16v_get_ele(ai, i); uint8_t pivot = PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16v_get_ele(ai, i);
r8 &= PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16_is_nonzero(pivot); r8 &= PQCLEAN_RAINBOWIACYCLIC_CLEAN_gf16_is_nonzero(pivot);

View File

@ -72,7 +72,7 @@ static unsigned int gf256mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsign
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + w * j; uint8_t *aj = mat + w * j;
PQCLEAN_RAINBOWVCCLASSIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1^PQCLEAN_RAINBOWVCCLASSIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4); PQCLEAN_RAINBOWVCCLASSIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1 ^ PQCLEAN_RAINBOWVCCLASSIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4);
} }
r8 &= PQCLEAN_RAINBOWVCCLASSIC_CLEAN_gf256_is_nonzero(ai[i]); r8 &= PQCLEAN_RAINBOWVCCLASSIC_CLEAN_gf256_is_nonzero(ai[i]);
uint8_t pivot = ai[i]; uint8_t pivot = ai[i];

View File

@ -72,7 +72,7 @@ static unsigned int gf256mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsign
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + w * j; uint8_t *aj = mat + w * j;
PQCLEAN_RAINBOWVCCYCLICCOMPRESSED_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1^PQCLEAN_RAINBOWVCCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4); PQCLEAN_RAINBOWVCCYCLICCOMPRESSED_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1 ^ PQCLEAN_RAINBOWVCCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4);
} }
r8 &= PQCLEAN_RAINBOWVCCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]); r8 &= PQCLEAN_RAINBOWVCCYCLICCOMPRESSED_CLEAN_gf256_is_nonzero(ai[i]);
uint8_t pivot = ai[i]; uint8_t pivot = ai[i];

View File

@ -72,7 +72,7 @@ static unsigned int gf256mat_gauss_elim_ref(uint8_t *mat, unsigned int h, unsign
for (unsigned int j = i + 1; j < h; j++) { for (unsigned int j = i + 1; j < h; j++) {
uint8_t *aj = mat + w * j; uint8_t *aj = mat + w * j;
PQCLEAN_RAINBOWVCCYCLIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1^PQCLEAN_RAINBOWVCCYCLIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4); PQCLEAN_RAINBOWVCCYCLIC_CLEAN_gf256v_predicated_add(ai + skip_len_align4, 1 ^ PQCLEAN_RAINBOWVCCYCLIC_CLEAN_gf256_is_nonzero(ai[i]), aj + skip_len_align4, w - skip_len_align4);
} }
r8 &= PQCLEAN_RAINBOWVCCYCLIC_CLEAN_gf256_is_nonzero(ai[i]); r8 &= PQCLEAN_RAINBOWVCCYCLIC_CLEAN_gf256_is_nonzero(ai[i]);
uint8_t pivot = ai[i]; uint8_t pivot = ai[i];

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256128FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256128FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256128SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256128SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256192FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256192FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256192SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256192SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256256FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256256FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256256SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);

View File

@ -67,7 +67,9 @@ void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
while (i < len) { while (i < len) {
bytes_to_copy = len - i; bytes_to_copy = len - i;
if (bytes_to_copy > 64) bytes_to_copy = 64; if (bytes_to_copy > 64) {
bytes_to_copy = 64;
}
memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 0], d0 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy); memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);