hmac

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. //////////////////////////////////////////////////////////////////////////////

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateParams

func ValidateParams(hash string, keySize uint32, tagSize uint32) error

ValidateParams validates parameters of Hmac constructor.

Types

type Hmac

type Hmac struct {
	HashFunc func() hash.Hash
	Key      []byte
	TagSize  uint32
}

Hmac implementation of interface tink.Mac

func New

func New(hashAlg string, key []byte, tagSize uint32) (*Hmac, error)

New creates a new instance of Hmac

func (*Hmac) ComputeMac

func (h *Hmac) ComputeMac(data []byte) ([]byte, error)

ComputeMac computes message authentication code (MAC) for the given data.

func (*Hmac) VerifyMac

func (h *Hmac) VerifyMac(mac []byte, data []byte) (bool, error)

VerifyMac verifies whether the given MAC is a correct authentication code (MAC) the given data.

Jump to

Keyboard shortcuts

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