fix discovery
replace custom calc with hmac in the generate_digest