Method: Crypt::Blowfish#f

Defined in:
lib/flatulent/crypt/blowfish.rb

#f(x) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/flatulent/crypt/blowfish.rb', line 30

def f(x)
  a, b, c, d = [x].pack('N').unpack('CCCC')
  y = (@sBoxes[0][a] + @sBoxes[1][b]) % ULONG
  y = (y ^ @sBoxes[2][c]) % ULONG
  y = (y + @sBoxes[3][d]) % ULONG
  return(y)
end