Lines Matching refs:tpm
103 static int get_tpm_nv_size(struct udevice *tpm, uint32_t index, uint32_t *size) in get_tpm_nv_size() argument
110 err = tpm_get_capability(tpm, TPM_CAP_NV_INDEX, index, in get_tpm_nv_size()
140 static int find_key(struct udevice *tpm, const uint8_t auth[20], in find_key() argument
153 err = tpm_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf, in find_key()
165 err = tpm_get_pub_key_oiap(tpm, key_handles[i], auth, buf, in find_key()
185 static int read_common_data(struct udevice *tpm) in read_common_data() argument
192 if (get_tpm_nv_size(tpm, NV_COMMON_DATA_INDEX, &size) || in read_common_data()
195 err = tpm_nv_read_value(tpm, NV_COMMON_DATA_INDEX, in read_common_data()
255 static struct h_reg *access_hreg(struct udevice *tpm, uint8_t spec, in access_hreg() argument
273 hre_tpm_err = tpm_pcr_read(tpm, HREG_IDX(spec), in access_hreg()
279 read_common_data(tpm); in access_hreg()
349 static int hre_op_loadkey(struct udevice *tpm, struct h_reg *src_reg, in hre_op_loadkey() argument
358 if (find_key(tpm, src_reg->digest, dst_reg->digest, &parent_handle)) in hre_op_loadkey()
360 hre_tpm_err = tpm_load_key2_oiap(tpm, parent_handle, key, key_size, in hre_op_loadkey()
377 static const uint8_t *hre_execute_op(struct udevice *tpm, const uint8_t **ip, in hre_execute_op() argument
409 src_reg = access_hreg(tpm, src_spec, HREG_RD); in hre_execute_op()
412 dst_reg = access_hreg(tpm, dst_spec, in hre_execute_op()
469 if (hre_op_loadkey(tpm, src_reg, dst_reg, data, data_size)) in hre_execute_op()
477 hre_tpm_err = tpm_extend(tpm, HREG_IDX(dst_spec), in hre_execute_op()
502 int hre_run_program(struct udevice *tpm, const uint8_t *code, size_t code_size) in hre_run_program() argument
511 if (!hre_execute_op(tpm, &ip, &code_left)) in hre_run_program()