siphash

package
v0.0.0-...-34d48bb Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package siphash implements a hash / MAC function developed Jean-Philippe Aumasson and Daniel J Bernstein in 2012. SipHash computes 64-bit message authentication code from a variable-length message and a 128-bit secret key. It was designed to be efficient even for short inputs, with performance comparable to non-cryptographic hash functions. This package implements SipHash with the recommended parameters: c = 2 and d = 4.

Index

Constants

View Source
const TagSize = 8

The size of the SipHash authentication tag in bytes.

Variables

This section is empty.

Functions

func New

func New(key *[16]byte) hash.Hash64

New returns a hash.Hash64 computing the SipHash checksum with a 128 bit key.

func Sum

func Sum(out *[TagSize]byte, msg []byte, key *[16]byte)

Sum generates an authenticator for msg with a 128 bit key and puts the 64 bit result into out.

func Sum64

func Sum64(msg []byte, key *[16]byte) uint64

Sum64 generates and returns the 64 bit authenticator for msg with a 128 bit key.

func Verify

func Verify(sum *[TagSize]byte, msg []byte, key *[16]byte) bool

Verify checks whether the given sum is equal to the computed checksum of msg. This function returns true if and only if the computed checksum is equal to the given sum.

Types

This section is empty.

Jump to

Keyboard shortcuts

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