rfc2104

package
v0.0.0-...-5caf956 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const INNER_PAD byte = 0x36

bytes used to perform XOR operations on key material

View Source
const OUTER_PAD byte = 0x5C

Variables

This section is empty.

Functions

func Hmac

func Hmac(key []byte, message []byte, algorithm string) []byte

generic hmac function

Types

type HMAC

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

hmac object type

func NewHmac

func NewHmac(key []byte, message []byte, algorithm string) HMAC

Create new HMAC computer Parameters: key: the hash key material message: the plaintext message of which the function will compute the HMAC digest difest_f: hash cpomputer init function

HMAC is computed as HMAC = HASH_FUNC((key xor outer_pad) + HASH_FUNC((key xor inner_pad) + message))

func (*HMAC) Digest

func (h *HMAC) Digest()

Calculate the HMAC digest value

func (*HMAC) HmacBytes

func (h *HMAC) HmacBytes() []byte

get hmac digest bytes

func (*HMAC) HmacString

func (h *HMAC) HmacString() string

get hmac digest in string format

Jump to

Keyboard shortcuts

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