Class: Noise::Functions::Hash::Blake2b

Inherits:
Object
  • Object
show all
Defined in:
lib/noise/functions/hash/blake2b.rb

Constant Summary collapse

HASHLEN =
64
BLOCKLEN =
128
DIGEST_NAME =

The name OpenSSL knows BLAKE2b with a 64 byte output by. OpenSSL only implements the fixed 512 bit output length, which is exactly the HASHLEN the Noise specification gives the BLAKE2b hash function.

'BLAKE2b512'

Instance Method Summary collapse

Instance Method Details

#blocklenObject



23
24
25
# File 'lib/noise/functions/hash/blake2b.rb', line 23

def blocklen
  BLOCKLEN
end

#hash(data) ⇒ Object



15
16
17
# File 'lib/noise/functions/hash/blake2b.rb', line 15

def hash(data)
  OpenSSL::Digest.digest(DIGEST_NAME, data)
end

#hashlenObject



19
20
21
# File 'lib/noise/functions/hash/blake2b.rb', line 19

def hashlen
  HASHLEN
end