MCPcopy
hub / github.com/OpenNHP/opennhp / HMAC1

Method HMAC1

nhp/core/kdf.go:13–25  ·  view source on GitHub ↗
(dst *[HashSize]byte, key, in0 []byte)

Source from the content-addressed store, hash-verified

11}
12
13func (n *NoiseFactory) HMAC1(dst *[HashSize]byte, key, in0 []byte) {
14 newHash := func() hash.Hash {
15 h, err := NewHash(n.HashType)
16 if err != nil {
17 panic("failed to create hash for HMAC: " + err.Error())
18 }
19 return h
20 }
21 mac := hmac.New(newHash, key)
22 mac.Write(in0)
23 mac.Sum(dst[:0])
24 mac.Reset()
25}
26
27func (n *NoiseFactory) HMAC2(dst *[HashSize]byte, key, in0, in1 []byte) {
28 newHash := func() hash.Hash {

Callers 3

KeyGen1Method · 0.95
KeyGen2Method · 0.95
KeyGen3Method · 0.95

Calls 3

NewHashFunction · 0.85
ErrorMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected