sphincs: satisfy test_boolean

这个提交包含在:
John M. Schanck 2020-09-15 12:50:49 -04:00 提交者 Kris Kwiatkowski
父节点 512adcc0db
当前提交 a8c4ac414b
共有 12 个文件被更改,包括 36 次插入12 次删除

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);

查看文件

@ -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);