From: fluffymormegil Date: Tue, 12 Oct 2010 23:16:45 +0000 (+0100) Subject: Fixed stupid error in S20prng.hh (poxy compiler...) X-Git-Tag: v1.0.0~22^2~6 X-Git-Url: http://git.blackswordsonics.com/?a=commitdiff_plain;h=59b462d105154fc775a599176eda15767c10688b;p=libmormegil Fixed stupid error in S20prng.hh (poxy compiler...) --- diff --git a/include/libmormegil/S20prng.hh b/include/libmormegil/S20prng.hh index ab6889a..a53269b 100644 --- a/include/libmormegil/S20prng.hh +++ b/include/libmormegil/S20prng.hh @@ -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)