Sha256: 0bef24e325b0b5fbfc1bbffb6235ba3312794f8c68e3eeb5292964416d266d14

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

module RubyClangFpe
  class FpeKey
    def self.generate_key(type, key, tweak, radix)
      new_key = case type
                when :ff3
                  if (tweak.size / 2) == 7
                    generate_ff3_1_key(key, tweak, radix)
                  else
                    generate_ff3_key(key, tweak, radix)
                  end
                when :ff1
                  generate_ff1_key(key, tweak, radix)
                end

      new_key
    end

    private_class_method :generate_ff3_key, :generate_ff1_key, :generate_ff3_1_key
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_clang_fpe-0.1.0 lib/ruby_clang_fpe/fpe_key.rb