2

Possible Duplicate:
what is wrong with my ripemd160 python code?

Assuming that everything else (functions, constants, etc) are correct, is this a correct main loop of ripemd160 for python?

for j in range(80):

   T = (a+ ROL( (F(b, c, d, j) + X[r[j]] + k[j/16])%2**32,s[j])+e)%2**32
   a = e; e = d; d = ROL(c, 10); c = b; a = T

   # parallel round
   T = (aa+ ROL( (F(bb,cc,dd,79-j) + X[rr[j]] + kk[j/16] )%2**32,ss[j])+ee)%2**32
   aa = ee; ee = dd; dd = ROL(cc,10); cc = bb; aa = T
Community
  • 1
  • 1
calccrypto
  • 131
  • 2
  • 5
  • You can write a test for your module based on the examples from this page: http://homes.esat.kuleuven.be/~bosselae/ripemd160.html – Mark Byers Jan 23 '10 at 21:18
  • im getting nothing correct, even when i copy their code and change it to python – calccrypto Jan 23 '10 at 21:39
  • 1
    Don't be lazy, print out the intermediate values using both the C code and your python code. Also, pay attention to what was posted in your other question. You are still being careless with your assumptions about integers and overflow. – President James K. Polk Jan 24 '10 at 02:19
  • i have nothing to check my intermediate values with – calccrypto Jan 26 '10 at 12:44
  • [Crypto++](http://www.cryptopp.com/) has an open source implementation of RIPEMD-160. I'm not sure if it uses the same control struture. – jww Jan 06 '12 at 23:03

0 Answers0