Lines Matching refs:tk

287 	struct tpm_key *tk = asymmetric_key->payload.data[asym_crypto];
289 if (!tk)
297 struct tpm_key *tk = payload0;
299 if (!tk)
302 kfree(tk->blob);
303 tk->blob_len = 0;
305 kfree(tk);
395 struct tpm_key *tk = params->key->payload.data[asym_crypto];
412 der_pub_key_len = derive_pub_key(tk->pub_key, tk->pub_key_len,
421 info->key_size = tk->key_len;
422 info->max_data_size = tk->key_len / 8;
425 info->max_dec_size = tk->key_len / 8;
443 static int tpm_key_encrypt(struct tpm_key *tk,
466 der_pub_key_len = derive_pub_key(tk->pub_key, tk->pub_key_len,
503 static int tpm_key_decrypt(struct tpm_key *tk,
529 tk->blob, tk->blob_len, &keyhandle);
627 static int tpm_key_sign(struct tpm_key *tk,
664 if (in_len > tk->key_len / 8 - 11) {
677 tk->blob, tk->blob_len, &keyhandle);
707 struct tpm_key *tk = params->key->payload.data[asym_crypto];
713 ret = tpm_key_encrypt(tk, params, in, out);
716 ret = tpm_key_decrypt(tk, params, in, out);
719 ret = tpm_key_sign(tk, params, in, out);
734 const struct tpm_key *tk = key->payload.data[asym_crypto];
746 BUG_ON(!tk);
761 der_pub_key_len = derive_pub_key(tk->pub_key, tk->pub_key_len,
813 static int extract_key_parameters(struct tpm_key *tk)
815 const void *cur = tk->blob;
816 uint32_t len = tk->blob_len;
890 tk->key_len = key_len;
891 tk->pub_key = pub_key;
892 tk->pub_key_len = sz;
901 struct tpm_key *tk;
914 tk = kzalloc(sizeof(struct tpm_key), GFP_KERNEL);
915 if (!tk)
918 tk->blob = kmemdup(blob, blob_len, GFP_KERNEL);
919 if (!tk->blob)
922 tk->blob_len = blob_len;
924 r = extract_key_parameters(tk);
928 return tk;
931 kfree(tk->blob);
932 tk->blob_len = 0;
934 kfree(tk);