sphincs: satisfy test_boolean

This commit is contained in:
John M. Schanck 2020-09-15 12:50:49 -04:00 committed by Kris Kwiatkowski
parent 512adcc0db
commit a8c4ac414b
12 changed files with 36 additions and 12 deletions

View File

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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

@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7, const unsigned char *d7,
unsigned long long len) { unsigned long long len) {
unsigned long long i = 0; unsigned long long i = 0;
unsigned long long bytes_to_copy;
while (i < len) { while (i < len) {
unsigned long long bytes_to_copy = (len - i) > 64 ? 64 : (len - i); bytes_to_copy = len - i;
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);