Sha256: 590e7bded9d7a37fbc49f3de67891b7bc32eb16e0f6dec6daac5c21b3fa79cdd

Contents?: true

Size: 316 Bytes

Versions: 1

Compression:

Stored size: 316 Bytes

Contents

require 'hkdf'

module Cryptosphere
  # Cryptographically secure key derivation function: HKDF (RFC 5869)
  #
  # Options:
  # * size: how many bytes of output to generate (default 32, i.e. 256 bits)
  def self.kdf(secret, options = {})
    size = options[:size] || 32
    HKDF.new(secret).next_bytes(size)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cryptosphere-0.0.0 lib/cryptosphere/crypto/kdf.rb