Thanks to visit codestin.com
Credit goes to pkg.go.dev

hmac

package standard library
go1.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package hmac implements HMAC according to FIPS 198-1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarkAsUsedInKDF

func MarkAsUsedInKDF(h *HMAC)

MarkAsUsedInKDF records that this HMAC instance is used as part of a KDF.

Types

type HMAC

type HMAC struct {
	// contains filtered or unexported fields
}

func New

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

New returns a new HMAC hash using the given hash.Hash type and key.

func (*HMAC) BlockSize

func (h *HMAC) BlockSize() int

func (*HMAC) Clone added in go1.25.0

func (h *HMAC) Clone() (hash.Cloner, error)

Clone implements hash.Cloner if the underlying hash does. Otherwise, it returns an error wrapping errors.ErrUnsupported.

func (*HMAC) Reset

func (h *HMAC) Reset()

func (*HMAC) Size

func (h *HMAC) Size() int

func (*HMAC) Sum

func (h *HMAC) Sum(in []byte) []byte

func (*HMAC) Write

func (h *HMAC) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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