/* runs a program on the hash register engine.  */
int hre_run_program(struct udevice *tpm, const uint8_t *code, size_t code_size)
/* runs a program on the hash register engine.  */
int hre_run_program(struct udevice *tpm, const uint8_t *code, size_t code_size)
{
	size_t code_left;
	const uint8_t *ip = code;
	code_left = code_size;
	hre_tpm_err = 0;
	hre_err = HRE_E_OK;
	while (code_left > 0)
		if (!hre_execute_op(tpm, &ip, &code_left))
			return -1;
	return hre_err;
}