Browse Source

sphincs: satisfy test_boolean

tags/v0.0.1
John M. Schanck 4 years ago
committed by Kris Kwiatkowski
parent
commit
a8c4ac414b
12 changed files with 36 additions and 12 deletions
  1. +3
    -1
      crypto_sign/sphincs-sha256-128f-robust/avx2/sha256avx.c
  2. +3
    -1
      crypto_sign/sphincs-sha256-128f-simple/avx2/sha256avx.c
  3. +3
    -1
      crypto_sign/sphincs-sha256-128s-robust/avx2/sha256avx.c
  4. +3
    -1
      crypto_sign/sphincs-sha256-128s-simple/avx2/sha256avx.c
  5. +3
    -1
      crypto_sign/sphincs-sha256-192f-robust/avx2/sha256avx.c
  6. +3
    -1
      crypto_sign/sphincs-sha256-192f-simple/avx2/sha256avx.c
  7. +3
    -1
      crypto_sign/sphincs-sha256-192s-robust/avx2/sha256avx.c
  8. +3
    -1
      crypto_sign/sphincs-sha256-192s-simple/avx2/sha256avx.c
  9. +3
    -1
      crypto_sign/sphincs-sha256-256f-robust/avx2/sha256avx.c
  10. +3
    -1
      crypto_sign/sphincs-sha256-256f-simple/avx2/sha256avx.c
  11. +3
    -1
      crypto_sign/sphincs-sha256-256s-robust/avx2/sha256avx.c
  12. +3
    -1
      crypto_sign/sphincs-sha256-256s-simple/avx2/sha256avx.c

+ 3
- 1
crypto_sign/sphincs-sha256-128f-robust/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-128f-simple/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-128s-robust/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-128s-simple/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256128SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-192f-robust/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-192f-simple/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-192s-robust/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-192s-simple/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256192SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-256f-robust/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256FROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-256f-simple/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256FSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-256s-robust/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256SROBUST_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


+ 3
- 1
crypto_sign/sphincs-sha256-256s-simple/avx2/sha256avx.c View File

@@ -63,9 +63,11 @@ void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_sha256_update8x(sha256ctxx8 *ctx,
const unsigned char *d7,
unsigned long long len) {
unsigned long long i = 0;
unsigned long long bytes_to_copy;

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 * 1], d1 + i, bytes_to_copy);
memcpy(&ctx->msgblocks[64 * 2], d2 + i, bytes_to_copy);


Loading…
Cancel
Save