package
0.0.0
Repository: https://github.com/crypto-y/babble.git
Documentation: pkg.go.dev

# README

Hash Functions

This package implements the hash functions specified in the noise protocol framework.

Built-in Hash Functions

Four hash functions are supported, as specified in the noise specs.

  1. SHA256
  2. SHA512
  3. BLAKE2b
  4. BLAKE2s

Customize Hash Functions

To create your own hash function, you'll need to implement the interface specified in hash.go. Once implemented, you need to register it using Register(Name, Hash).

Check examples/newhash, which implements SHA3, once implemented, Once implemented, it can be used via the protocol name,

// register SHA3
noiseHash.Register("SHA3", newSha3)

// Now "SHA3" is a valid hash name, and it can be used in the protocol name as,
p, _ := babble.NewProtocol("Noise_NN_25519_ChaChaPoly_SHA3", "Demo", true)

# Functions

FromString uses the provided hash name, s, to query a built-in hash.
Register updates the supported hashes used in package hash.
SupportedHashes gives the names of all the hashs registered.

# Interfaces

Hash defines a hash interface specified by the noise specs.

# Type aliases

NewHash returns an instance of Hash.