Fixed stupid error in S20prng.hh (poxy compiler...)
authorfluffymormegil <mpread@chiark.greenend.org.uk>
Tue, 12 Oct 2010 23:16:45 +0000 (00:16 +0100)
committerfluffymormegil <mpread@chiark.greenend.org.uk>
Tue, 12 Oct 2010 23:16:45 +0000 (00:16 +0100)
include/libmormegil/S20prng.hh

index ab6889a..a53269b 100644 (file)
@@ -95,33 +95,36 @@ namespace libmormegil
         }
         void runstate()
         {
-                state[0] = Fixed1;
-                state[1] = key[0];
-                state[2] = key[1];
-                state[3] = key[2];
-                state[4] = key[3];
-                state[5] = Fixed2;
-                state[6] = nonce[0];
-                state[7] = nonce[1];
-                state[8] = counter;
-                state[9] = counter >> 32;
-                state[10] = Fixed3;
-                state[11] = key[4];
-                state[12] = key[5];
-                state[13] = key[6];
-                state[14] = key[7];
-                state[15] = Fixed4;
-                slash(12);
+            state[0] = Fixed1;
+            state[1] = key[0];
+            state[2] = key[1];
+            state[3] = key[2];
+            state[4] = key[3];
+            state[5] = Fixed2;
+            state[6] = nonce[0];
+            state[7] = nonce[1];
+            state[8] = counter;
+            state[9] = counter >> 32;
+            state[10] = Fixed3;
+            state[11] = key[4];
+            state[12] = key[5];
+            state[13] = key[6];
+            state[14] = key[7];
+            state[15] = Fixed4;
+            slash(12);
         }
         uint32_t generate()
         {
+            uint32_t ret;
             if (!subcounter)
             {
                 runstate();
                 ++counter;
             }
+            ret = state[subcounter];
             ++subcounter;
             subcounter &= 15;
+            return ret;
         }
         void initialize(const uint32_t *k, const uint32_t *n,
                         const uint64_t *c, const int *s)