hmac

package
v0.0.0-...-956af9a Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package hmac provides an interface to the OpenSSL hmac api to be compatible with Go's stdlib api. See http://www.openssl.org/docs/crypto/hmac.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(mac1, mac2 []byte) bool

Equal compares two MACs for equality without leaking timing information.

func New

func New(h func() hash.Hash, key []byte) hash.Hash

New returns a new HMAC hash using the given hash.Hash type and key. If the returned hash is `nil` make a call to `sslerr.Error()` to know what went wrong. Currently only `crypto.SHA512`, `crypto.SHA384`, `crypto.SHA256`, `crypto.SHA224`, `cryptoSHA1` and `crypto.MD5` are the only supported hashes. If an unsupported hash is provided the function will just return `nil` and no error from `sslerr` is given.

func NewWithEngine

func NewWithEngine(e *engine.Engine, h func() hash.Hash, key []byte) hash.Hash

NewWithEngine behaves the same as New but it accepts a pointer to an `engine.Engine` to setup the engine to use during ctx setup.

Types

This section is empty.

Jump to

Keyboard shortcuts

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