package hmac

import "crypto/internal/fips140/hmac"

Package hmac implements HMAC according to FIPS 198-1.

Index

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

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

Clone implements hash.Cloner if the underlying hash does. Otherwise, it returns 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)

Source Files

cast.go hmac.go

Version
v1.25.0-rc.1
Published
Jun 11, 2025
Platform
js/wasm
Imports
7 packages
Last checked
12 minutes ago

Tools for package owners.