primitives

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NonceSize is the default NonceSize
	NonceSize = 24
)

Variables

This section is empty.

Functions

func GetDefaultCurve

func GetDefaultCurve() elliptic.Curve

GetDefaultCurve returns the default elliptic curve used by the crypto layer

func GetDefaultHash

func GetDefaultHash() func() hash.Hash

GetDefaultHash returns the default hash function used by the crypto layer

func GetHashAlgorithm

func GetHashAlgorithm() string

GetHashAlgorithm return the default hash algorithm

func GetRandomBytes

func GetRandomBytes(len int) ([]byte, error)

GetRandomBytes returns len random looking bytes

func GetRandomNonce

func GetRandomNonce() ([]byte, error)

GetRandomNonce returns a random byte array of length NonceSize

func HMACTruncated

func HMACTruncated(key, x []byte, truncation int) []byte

HMACTruncated hmacs x using key key and truncate to truncation

func Hash

func Hash(msg []byte) []byte

Hash hashes the msh using the predefined hash function

func InitSecurityLevel

func InitSecurityLevel(algorithm string, level int) (err error)

InitSecurityLevel initialize the crypto layer at the given security level

func NewHash

func NewHash() hash.Hash

NewHash returns a new hash function

func SetSecurityLevel

func SetSecurityLevel(algorithm string, level int) (err error)

SetSecurityLevel sets the security configuration with the hash length and the algorithm

Types

This section is empty.

Jump to

Keyboard shortcuts

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