Sha256: e572c975640e1bf1066b75476ba1964f17f233b177b15e3b8a7d234529892655

Contents?: true

Size: 548 Bytes

Versions: 18

Compression:

Stored size: 548 Bytes

Contents

# frozen_string_literal: true

module Noise
  module Functions
    module Hash
      class Blake2b
        HASHLEN = 64
        BLOCKLEN = 128
        def hash(data)
          RbNaCl::Hash.blake2b(data)
        end

        def hashlen
          HASHLEN
        end

        def blocklen
          BLOCKLEN
        end
      end

      class Blake2bHMAC < HMAC::Base
        def initialize(key = nil)
          super(RbNaCl::Hash::Blake2b, 128, 64, key)
        end
        public_class_method :new, :digest, :hexdigest
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
noise-ruby-0.10.1 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.10.0 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.9.4 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.8.4 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.7.4 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.7.3 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.7.1 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.7.0 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.6.3 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.6.2 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.6.1 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.6.0 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.5.3 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.5.2 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.5.1 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.5.0 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.3.0 lib/noise/functions/hash/blake2b.rb
noise-ruby-0.2.0 lib/noise/functions/hash/blake2b.rb