// hmac uses the subprocess to compute HMAC and returns the result.

hmac uses the subprocess to compute HMAC and returns the result.
// hmac uses the subprocess to compute HMAC and returns the result .
func (h *hmacPrimitive) hmac(msg []byte, key []byte, outBits int, m Transactable) []byte {
	if outBits%8 != 0 {
		panic("fractional-byte output length requested: " + strconv.Itoa(outBits))
	}
	outBytes := outBits / 8
	result, err := m.Transact(h.algo, 1, msg, key)
	if err != nil {
		panic("HMAC operation failed: " + err.Error())
	}
	if l := len(result[0]); l < outBytes {
		panic(fmt.Sprintf("HMAC result too short: %d bytes but wanted %d", l, outBytes))
	}
	return result[0][:outBytes]
}
func ( h * hmacPrimitive ) hmac ( msg [ ] byte , key [ ] byte , outBits int , m Transactable ) [ ] byte { if outBits % 8 != 0 { panic ( " " + strconv . Itoa ( outBits ) ) } outBytes := outBits / 8 result , err := m . Transact ( h . algo , 1 , msg , key ) if err != nil { panic ( " " + err . Error ( ) ) } if l := len ( result [ 0 ] ) ; l < outBytes { panic ( fmt . Sprintf ( " " , l , outBytes ) ) } return result [ 0 ] [ : outBytes ] }
hmac uses the subprocess to compute HMAC and returns the result.
hmac uses the subprocess to compute HMAC and returns the result .