From 5b8f095b93b9ce1e763274c8d64a542be5d3f2e0 Mon Sep 17 00:00:00 2001 From: Christophe Oosterlynck Date: Thu, 13 Nov 2008 18:39:59 +0100 Subject: [PATCH] RadioGatun: further parametrized doesn't crash anymore when changing beltWidth and using a beltLength<13 --- src/CryptoPlus/Hash/pyradiogatun.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CryptoPlus/Hash/pyradiogatun.py b/src/CryptoPlus/Hash/pyradiogatun.py index 2f28af0..e8368dc 100644 --- a/src/CryptoPlus/Hash/pyradiogatun.py +++ b/src/CryptoPlus/Hash/pyradiogatun.py @@ -52,7 +52,7 @@ def XOR_F_i(state,inp,wl): # block to integer p_i = string2number(inp[i*wl:(i+1)*wl][::-1]) state["B"][0][i] ^= p_i - state["A"][i+16] ^= p_i + state["A"][i+millSize-beltWidth] ^= p_i return state def R(state,wl): @@ -71,7 +71,7 @@ def R(state,wl): out["A"] = Mill(state["A"],wl) # Belt to mill feedforward for i in xrange(beltWidth): - out["A"][i+beltLength] ^= state["B"][beltLength-1][i] + out["A"][i+beltLength] ^= state["B"][-1][i] return out def Mill(a,wl): @@ -111,7 +111,7 @@ class RadioGatunType: # word & block length in bytes self.wordlength = wl/8 - self.blocklength = self.wordlength*3 + self.blocklength = self.wordlength*beltWidth # Initial message length in bits(!). self.length = 0 -- 2.11.4.GIT