siphash: github.com/dchest/siphash Index | Files

package siphash

import "github.com/dchest/siphash"

Package siphash implements SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J. Bernstein.

Index

Package Files

blocks_asm.go hash_asm.go siphash.go

Constants

const (
    // BlockSize is the block size of hash algorithm in bytes.
    BlockSize = 8

    // Size is the size of hash output in bytes.
    Size = 8

    // Size128 is the size of 128-bit hash output in bytes.
    Size128 = 16
)

func Hash Uses

func Hash(k0, k1 uint64, b []byte) uint64

Hash returns the 64-bit SipHash-2-4 of the given byte slice with two 64-bit parts of 128-bit key: k0 and k1.

func Hash128 Uses

func Hash128(k0, k1 uint64, b []byte) (uint64, uint64)

Hash128 returns the 128-bit SipHash-2-4 of the given byte slice with two 64-bit parts of 128-bit key: k0 and k1.

func New Uses

func New(key []byte) hash.Hash64

New returns a new hash.Hash64 computing SipHash-2-4 with 16-byte key and 8-byte output.

func New128 Uses

func New128(key []byte) hash.Hash

New128 returns a new hash.Hash computing SipHash-2-4 with 16-byte key and 16-byte output.

Note that 16-byte output is considered experimental by SipHash authors at this time.

Package siphash imports 1 packages (graph) and is imported by 101 packages. Updated 2018-08-20. Refresh now. Tools for package owners.