Lines Matching refs:tpm

101 static int get_tpm_nv_size(struct udevice *tpm, uint32_t index, uint32_t *size)  in get_tpm_nv_size()  argument
108 err = tpm_get_capability(tpm, TPM_CAP_NV_INDEX, index, in get_tpm_nv_size()
138 static int find_key(struct udevice *tpm, const uint8_t auth[20], in find_key() argument
151 err = tpm_get_capability(tpm, TPM_CAP_HANDLE, TPM_RT_KEY, buf, in find_key()
163 err = tpm_get_pub_key_oiap(tpm, key_handles[i], auth, buf, in find_key()
183 static int read_common_data(struct udevice *tpm) in read_common_data() argument
190 if (get_tpm_nv_size(tpm, NV_COMMON_DATA_INDEX, &size) || in read_common_data()
193 err = tpm_nv_read_value(tpm, NV_COMMON_DATA_INDEX, in read_common_data()
253 static struct h_reg *access_hreg(struct udevice *tpm, uint8_t spec, in access_hreg() argument
271 hre_tpm_err = tpm_pcr_read(tpm, HREG_IDX(spec), in access_hreg()
277 read_common_data(tpm); in access_hreg()
347 static int hre_op_loadkey(struct udevice *tpm, struct h_reg *src_reg, in hre_op_loadkey() argument
356 if (find_key(tpm, src_reg->digest, dst_reg->digest, &parent_handle)) in hre_op_loadkey()
358 hre_tpm_err = tpm_load_key2_oiap(tpm, parent_handle, key, key_size, in hre_op_loadkey()
375 static const uint8_t *hre_execute_op(struct udevice *tpm, const uint8_t **ip, in hre_execute_op() argument
407 src_reg = access_hreg(tpm, src_spec, HREG_RD); in hre_execute_op()
410 dst_reg = access_hreg(tpm, dst_spec, in hre_execute_op()
467 if (hre_op_loadkey(tpm, src_reg, dst_reg, data, data_size)) in hre_execute_op()
475 hre_tpm_err = tpm_extend(tpm, HREG_IDX(dst_spec), in hre_execute_op()
500 int hre_run_program(struct udevice *tpm, const uint8_t *code, size_t code_size) in hre_run_program() argument
509 if (!hre_execute_op(tpm, &ip, &code_left)) in hre_run_program()