package

hmac

crypto/internal/fips140/v1.26.0-cd900eea/hmac

Package hmac implements HMAC according to FIPS 198-1.

Functions

MarkAsUsedInKDFsource

func MarkAsUsedInKDF(h *HMAC)

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

type HMAC source

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

Constructors

Newsource

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.

Methods

Sumsource

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

Writesource

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