Add braces to shut compiler up. Reformat code slightly.
authormdw <mdw>
Sat, 17 Jun 2000 12:21:39 +0000 (12:21 +0000)
committermdw <mdw>
Sat, 17 Jun 2000 12:21:39 +0000 (12:21 +0000)
fipstest.c

index cdfcc05..9febfd4 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
 /* -*-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
  *
  *
  * FIPS 140-1 randomness tests
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: fipstest.c,v $
 /*----- 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.
  *
  * Revision 1.1  2000/06/17 10:55:38  mdw
  * FIPS 140-1 random generator test.
  *
@@ -133,7 +136,7 @@ static unsigned runs(const octet *p)
   unsigned i, j;
   unsigned r = 0;
   unsigned bb = 0;
   unsigned i, j;
   unsigned r = 0;
   unsigned bb = 0;
-  unsigned f[2][6] = { 0 };
+  unsigned f[2][6] = { { 0 } };
 
   /* --- Count the run lengths --- */
 
 
   /* --- Count the run lengths --- */
 
@@ -166,18 +169,12 @@ static unsigned runs(const octet *p)
 
   /* --- Check the results --- */
 
 
   /* --- 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);      
     rc |= FIPSTEST_RUNS;
 
   return (rc);