/* -*-c-*-
*
- * $Id: fipstest.c,v 1.1 2000/06/17 10:55:38 mdw Exp $
+ * $Id: fipstest.c,v 1.2 2000/06/17 12:21:39 mdw Exp $
*
* FIPS 140-1 randomness tests
*
/*----- Revision history --------------------------------------------------*
*
* $Log: fipstest.c,v $
+ * Revision 1.2 2000/06/17 12:21:39 mdw
+ * Add braces to shut compiler up. Reformat code slightly.
+ *
* Revision 1.1 2000/06/17 10:55:38 mdw
* FIPS 140-1 random generator test.
*
unsigned i, j;
unsigned r = 0;
unsigned bb = 0;
- unsigned f[2][6] = { 0 };
+ unsigned f[2][6] = { { 0 } };
/* --- Count the run lengths --- */
/* --- Check the results --- */
- if (2267 > f[0][0] || f[0][0] > 2733 ||
- 2267 > f[1][0] || f[1][0] > 2733 ||
- 1079 > f[0][1] || f[0][1] > 1421 ||
- 1079 > f[1][1] || f[1][1] > 1421 ||
- 502 > f[0][2] || f[0][2] > 748 ||
- 502 > f[1][2] || f[1][2] > 748 ||
- 223 > f[0][3] || f[0][3] > 402 ||
- 223 > f[1][3] || f[1][3] > 402 ||
- 90 > f[0][4] || f[0][4] > 223 ||
- 90 > f[1][4] || f[1][4] > 223 ||
- 90 > f[0][5] || f[0][5] > 223 ||
- 90 > f[1][5] || f[1][5] > 223)
+ if (2267 > f[0][0] || f[0][0] > 2733 || 2267 > f[1][0] || f[1][0] > 2733 ||
+ 1079 > f[0][1] || f[0][1] > 1421 || 1079 > f[1][1] || f[1][1] > 1421 ||
+ 502 > f[0][2] || f[0][2] > 748 || 502 > f[1][2] || f[1][2] > 748 ||
+ 223 > f[0][3] || f[0][3] > 402 || 223 > f[1][3] || f[1][3] > 402 ||
+ 90 > f[0][4] || f[0][4] > 223 || 90 > f[1][4] || f[1][4] > 223 ||
+ 90 > f[0][5] || f[0][5] > 223 || 90 > f[1][5] || f[1][5] > 223)
rc |= FIPSTEST_RUNS;
return (rc);