Source File
hmac.go
Belonging Package
crypto/hmac
package hmac
import (
)
marshaled bool
}
func ( *hmac) ( []byte) []byte {
:= len()
= .inner.Sum()
if .marshaled {
if := .outer.(marshalable).UnmarshalBinary(.opad); != nil {
panic()
}
} else {
.outer.Reset()
.outer.Write(.opad)
}
.outer.Write([:])
return .outer.Sum([:])
}
func ( *hmac) ( []byte) ( int, error) {
return .inner.Write()
}
func ( *hmac) () int { return .outer.Size() }
func ( *hmac) () int { return .inner.BlockSize() }
func ( *hmac) () {
if .marshaled {
if := .inner.(marshalable).UnmarshalBinary(.ipad); != nil {
panic()
}
return
}
.inner.Reset()
.inner.Write(.ipad)
, := .inner.(marshalable)
if ! {
return
}
, := .outer.(marshalable)
if ! {
return
}
, := .MarshalBinary()
if != nil {
return
}
.outer.Reset()
.outer.Write(.opad)
, := .MarshalBinary()
if != nil {
return
}
return subtle.ConstantTimeCompare(, ) == 1
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |