hmacsha256

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package hmacsha256 computes HMAC-SHA256 digests without the hash objects crypto/hmac builds for each MAC. Those objects were five allocations on every SigV4 signature and every HS256 verification, which is a cost a TinyGo program pays in collector time on each request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sum

func Sum(key, data []byte) [sha256.Size]byte

Sum returns HMAC-SHA256 of data under key, as RFC 2104 defines it.

Both passes are sha256.Sum256 over a buffer in this frame; the inner pass moves to the heap only when data is larger than the stack buffer, which a signing string or a token's signing input is not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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