blake2s

package module
v0.0.0-...-370b96e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 3 Imported by: 0

README

Godoc Reference

The BLAKE2s hash algorithm

BLAKE2s is a fast cryptographic hash function described in RFC 7963. BLAKE2s can be directly keyed, making it functionally equivalent to a Message Authentication Code (MAC).

Recommendation

This BLAKE2s implementation was submitted to the golang x/crypto repo. I recommend to use the official x/crypto/blake2s package if possible.

Installation

Install in your GOPATH: go get -u github.com/aead/blake2s

Performance

AMD64
Hardware: Intel i7-6500U 2.50GHz x 2
System: Linux Ubuntu 16.04 - kernel: 4.4.0-64-generic
Go version: 1.8.0

SSE4.1
name        speed           cpb
Write64-4  261MB/s ± 0%     9.14
Write1K-4  323MB/s ± 0%     7.38
Sum64-4    215MB/s ± 0%    11.09 
Sum1K-4    317MB/s ± 0%     7.52

SSSE3
name        speed           cpb
Write64-4  191MB/s ± 0%    12.48 
Write1K-4  220MB/s ± 0%    10.84
Sum64-4    165MB/s ± 0%    14.45
Sum1K-4    217MB/s ± 0%    10.99

SSE2
name        speed           cpb
Write64-4  177MB/s ± 0%    13.47
Write1K-4  201MB/s ± 0%    11.86
Sum64-4    154MB/s ± 0%    15.48
Sum1K-4    199MB/s ± 0%    11.98

Documentation

Overview

Package blake2s implements the BLAKE2s hash algorithm as defined in RFC 7693.

Index

Constants

View Source
const (
	// The blocksize of BLAKE2s in bytes.
	BlockSize = 64
	// The hash size of BLAKE2s-256 in bytes.
	Size = 32
	// The hash size of BLAKE2s-224 in bytes.
	Size224 = 28
	// The hash size of BLAKE2s-160 in bytes.
	Size160 = 20
	// The hash size of BLAKE2s-128 in bytes.
	Size128 = 16
)

Variables

This section is empty.

Functions

func New128

func New128(key []byte) (hash.Hash, error)

New128 returns a new hash.Hash computing the BLAKE2s-128 checksum. A non-nil key turns the hash into a MAC. The key must between zero and 32 bytes long.

func New160

func New160(key []byte) (hash.Hash, error)

New160 returns a new hash.Hash computing the BLAKE2s-160 checksum. A non-nil key turns the hash into a MAC. The key must between zero and 32 bytes long.

func New224

func New224(key []byte) (hash.Hash, error)

New224 returns a new hash.Hash computing the BLAKE2s-224 checksum. A non-nil key turns the hash into a MAC. The key must between zero and 32 bytes long.

func New256

func New256(key []byte) (hash.Hash, error)

New256 returns a new hash.Hash computing the BLAKE2s-256 checksum. A non-nil key turns the hash into a MAC. The key must between zero and 32 bytes long.

func Sum128

func Sum128(data []byte) [Size128]byte

Sum128 returns the BLAKE2s-128 checksum of the data.

func Sum160

func Sum160(data []byte) [Size160]byte

Sum160 returns the BLAKE2s-160checksum of the data.

func Sum224

func Sum224(data []byte) [Size224]byte

Sum224 returns the BLAKE2s-224 checksum of the data.

func Sum256

func Sum256(data []byte) [Size]byte

Sum256 returns the BLAKE2s-256 checksum of the data.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL