What was I missing that I needed to get it done? Bitwise operators and data type knowledge. I spent some time today writing a few programs to test bitwise operators and try to understand whats going on. The ones that gave me the most trouble were the shift operators. For some reason I had it firmly in my mind that they acted like shift registers (think hardware). I kept trying to shift one number into another bit by bit.
Only when I set up some runs and included a binary printout after each step did it actually click what was going on with those operators. I felt silly.
Anyway, here’s a link to the source of my little bitwise operator (mostly shifts) example. I didn’t write that binary printer BTW. I did, however, write that code highlighter system using GeSHi, which rocks.
Blowfish Version 1