// NewWithEngine behaves the same as New but it accepts a pointer to an
// `engine.Engine` to setup the engine to use during ctx setup.
NewWithEngine behaves the same as New but it accepts a pointer to an
`engine.Engine` to setup the engine to use during ctx setup.
// NewWithEngine behaves the same as New but it accepts a pointer to an // ` engine . Engine ` to setup the engine to use during ctx setup .
func NewWithEngine(e *engine.Engine, h func() hash.Hash, key []byte) hash.Hash {
	if h == nil {
		return nil
	}
	evp := getEVP(h())
	if evp == nil {
		return nil
	}
	var eng *C.ENGINE
	if e != nil {
		eng = (*C.ENGINE)(e.GetCEngine())
	}
	hm := new(hmac)
	C.HMAC_CTX_init(&hm.ctx)
	if C.HMAC_Init_ex(&hm.ctx, unsafe.Pointer(C.CString(string(key))), C.int(len(key)), evp, eng) != 1 {
		return nil
	}
	runtime.SetFinalizer(hm, cleanup)
	return hm
}
func NewWithEngine ( e * engine . Engine , h func ( ) hash . Hash , key [ ] byte ) hash . Hash { if h == nil { return nil } evp := getEVP ( h ( ) ) if evp == nil { return nil } var eng * C . ENGINE if e != nil { eng = ( * C . ENGINE ) ( e . GetCEngine ( ) ) } hm := new ( hmac ) C . HMAC_CTX_init ( & hm . ctx ) if C . HMAC_Init_ex ( & hm . ctx , unsafe . Pointer ( C . CString ( string ( key ) ) ) , C . int ( len ( key ) ) , evp , eng ) != 1 { return nil } runtime . SetFinalizer ( hm , cleanup ) return hm }
NewWithEngine behaves the same as New but it accepts a pointer to an
`engine.Engine` to setup the engine to use during ctx setup.
NewWithEngine behaves the same as New but it accepts a pointer to an ` engine . Engine ` to setup the engine to use during ctx setup .