I've never programmed in ruby and I'm porting this to c# for the .net crowd.
I get an issue where left_key_half is always 0 after being shifted >> 64
I'm calling key_gen (line 32 encryption.rb),then (line 41 encryption.rb) encrypt_register, goes to (line 84 encryption.rb) left_key_half
left_key_half is always 0 after the shift.
This is happening on my side because the left_key_half is 64bits long and the whole thing is being shifted out to 0
Is the indented code line 85-90 in encryption.rb doing something that I don't quite understand because I don't know ruby or is it just a formatting issue?
What I need to know is, Is the Ruby code doing something special based on the indented syntax?
I have the ansi doc for DUKPT and will read up on it, but your help would be greatly appreciated.