Skip to content

Commit

Permalink
crypto-tests/crypto_sort_uint32test.c rm pseudorand. test
Browse files Browse the repository at this point in the history
fixes build on big-endian platforms
  • Loading branch information
janmojzis committed Mar 10, 2022
1 parent f198f15 commit d4a9b78
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions crypto-tests/crypto_sort_uint32test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,9 @@ static void test_i(void) {
if (x[4] != (crypto_uint32) -1) fail("crypto_sort_uint32() failure");
}

#define SPACESIZE 123

static crypto_uint32 space[SPACESIZE + 4];
static crypto_uint32 buf[SPACESIZE + 4];

static unsigned char test_pseudorandom_checksum[32] = {
0xb6, 0x48, 0x52, 0x41, 0xd0, 0x19, 0xa7, 0x8c,
0x61, 0x4d, 0x29, 0x9d, 0x1f, 0xda, 0xb9, 0xc5,
0xbd, 0x47, 0xe6, 0x7f, 0xc2, 0xf3, 0x2e, 0xfd,
0x32, 0x21, 0x7a, 0x7b, 0xbb, 0xec, 0x02, 0x08
};

static void test_pseudorandom(void) {

long long i, j;

checksum_zero();
i = 0;
for (j = 0; j < SPACESIZE; j += 1 + j / 4) {
pseudorandombytes(space + i, sizeof(crypto_uint32) * j);
crypto_sort_uint32(space + i, j);
checksum(space + i, sizeof(crypto_uint32) * j);
++i;
i %= 4;
}
fail_whenbadchecksum(test_pseudorandom_checksum);
}

int main(void) {

test_321();
test_i();
test_pseudorandom();
_exit(0);
}

0 comments on commit d4a9b78

Please sign in to comment.