lib/megar/crypto/aes_ctr.rb
def str_to_a32(b,signed=true)
    a = Array.new((b.length+3) >> 2,0)
    b.length.times { |i| a[i>>2] |= (b.getbyte(i) << (24-(i & 3)*8)) }
    if signed
      a.pack('l>*').unpack('l>*')
    else
      a
    end
  end
# TODO: refactor to pull this method from a shared lib.
refactor to pull this method from a shared lib.
refactor to pull this method from a shared lib .
def str_to_a32(b,signed=true)
    a = Array.new((b.length+3) >> 2,0)
    b.length.times { |i| a[i>>2] |= (b.getbyte(i) << (24-(i & 3)*8)) }
    if signed
      a.pack('l>*').unpack('l>*')
    else
      a
    end
  end
def str_to_a32 ( b , signed = true ) a = Array . new ( ( b . length + 3 ) >> 2 , 0 ) b . length . times { | i | a [ i >> 2 ] |= ( b . getbyte ( i ) << ( 24 - ( i & 3 ) * 8 ) ) } if signed a . pack ( 'l>*' ) . unpack ( 'l>*' ) else a end end
TODO: refactor to pull this method from a shared lib.
TODO : refactor to pull this method from a shared lib .
b
signed