FAQ

On Tue, Oct 9, 2012 at 2:16 PM, Maxim Khitrov wrote:
// Verify compares the HMAC tag in b with the current hash value
// returned by h, truncated to t bytes. If len(b) > t, all preceding
// bytes are written to h before the comparison. h.Size() is used
// for t if t <= 0.
func Verify(b []byte, t int, h hash.Hash)

You can obviously remove t if you think that complicates the interface
beyond what is acceptable in the standard library, but truncation is a
normal part of HMAC operations (RFC 2104 section 5).
I quite like that too, but I worry that it precludes avoiding the
allocation each time when calling Sum. Without this function, users
would are verifying many MACs can reuse storage. But, since
escape-analysis isn't going to work through the interface, I think
this would have to allocate every time.


Cheers

AGL

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 7 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 8, '12 at 6:36p
activeOct 11, '12 at 7:28p
posts7
users3
websitegolang.org

3 users in discussion

Agl: 4 posts Rsc: 2 posts Maxim Khitrov: 1 post

People

Translate

site design / logo © 2022 Grokbase