Skip to content

Commit add3554

Browse files
committed
More C90 fixes
Signed-off-by: Brendan Moran <[email protected]>
1 parent 0268354 commit add3554

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/test_unit.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ static int test_shake128x4_api(void)
516516

517517
for (bi = 0; bi < block_count; bi++)
518518
{
519-
nblocks = block_counts[bi];
520519
test_priv_shake128x4ctx ref_copy;
521520
mld_shake128x4ctx dut_copy;
521+
nblocks = block_counts[bi];
522522
memcpy(&ref_copy, &ref_ctx, sizeof(ref_ctx));
523523
memcpy(&dut_copy, &dut_ctx, sizeof(dut_ctx));
524524
for (ch = 0; ch < MLD_KECCAK_WAY; ch++)
@@ -587,9 +587,9 @@ static int test_shake256x4_api(void)
587587

588588
for (bi = 0; bi < block_count; bi++)
589589
{
590-
nblocks = block_counts[bi];
591590
test_priv_shake256x4ctx ref_copy;
592591
mld_shake256x4ctx dut_copy;
592+
nblocks = block_counts[bi];
593593
memcpy(&ref_copy, &ref_ctx, sizeof(ref_ctx));
594594
memcpy(&dut_copy, &dut_ctx, sizeof(dut_ctx));
595595

@@ -743,12 +743,17 @@ static int test_x4_permute(void)
743743
/* Testcase 1: first channel all 0x5555..., others zero */
744744
{
745745
uint64_t init[4][MLD_KECCAK_LANES] = {{0}};
746+
uint64_t ref[4][MLD_KECCAK_LANES];
747+
uint64_t x4buf[MLD_KECCAK_LANES * MLD_KECCAK_WAY];
748+
#if defined(MLD_USE_FIPS202_X4_XOR_NATIVE)
749+
uint64_t inter_out[4][MLD_KECCAK_LANES];
750+
uint64_t inter[4][MLD_KECCAK_LANES];
751+
#endif
746752
for (ch = 0; ch < 4; ch++)
747753
{
748754
init[ch][0] = 0x5555555555555555ULL;
749755
}
750756

751-
uint64_t ref[4][MLD_KECCAK_LANES];
752757
memcpy(ref[0], init[0], sizeof ref[0]);
753758
memcpy(ref[1], init[1], sizeof ref[1]);
754759
memcpy(ref[2], init[2], sizeof ref[2]);
@@ -758,16 +763,13 @@ static int test_x4_permute(void)
758763
test_priv_keccakf1600_permute(ref[2]);
759764
test_priv_keccakf1600_permute(ref[3]);
760765

761-
uint64_t x4buf[MLD_KECCAK_LANES * MLD_KECCAK_WAY];
762766
#if defined(MLD_USE_FIPS202_X4_XOR_NATIVE)
763-
uint64_t inter[4][MLD_KECCAK_LANES];
764767
for (ch = 0; ch < 4; ch++)
765768
{
766769
interleave_state(inter[ch], init[ch]);
767770
}
768771
pack_x4_native(x4buf, inter);
769772
mld_keccakf1600x4_permute(x4buf);
770-
uint64_t inter_out[4][MLD_KECCAK_LANES];
771773
unpack_x4_native(inter_out, x4buf);
772774
for (ch = 0; ch < 4; ch++)
773775
{

0 commit comments

Comments
 (0)