Rollback to previous hmac re-work

This re-instates the hmac rework