Lines Matching refs:res

20 	TEE_Result res;  in hkdf_extract()  local
32 res = tee_alg_get_digest_size(hash_algo, &salt_len); in hkdf_extract()
33 if (res != TEE_SUCCESS) in hkdf_extract()
37 res = crypto_mac_alloc_ctx(&ctx, hmac_algo); in hkdf_extract()
38 if (res) in hkdf_extract()
47 res = crypto_mac_init(ctx, salt, salt_len); in hkdf_extract()
48 if (res != TEE_SUCCESS) in hkdf_extract()
51 res = crypto_mac_update(ctx, ikm, ikm_len); in hkdf_extract()
52 if (res != TEE_SUCCESS) in hkdf_extract()
55 res = crypto_mac_final(ctx, prk, *prk_len); in hkdf_extract()
56 if (res != TEE_SUCCESS) in hkdf_extract()
59 res = tee_alg_get_digest_size(hash_algo, prk_len); in hkdf_extract()
62 return res; in hkdf_extract()
71 TEE_Result res = TEE_SUCCESS; in hkdf_expand() local
76 res = tee_alg_get_digest_size(hash_algo, &hash_len); in hkdf_expand()
77 if (res != TEE_SUCCESS) in hkdf_expand()
81 res = TEE_ERROR_BAD_STATE; in hkdf_expand()
88 res = crypto_mac_alloc_ctx(&ctx, hmac_algo); in hkdf_expand()
89 if (res) in hkdf_expand()
98 res = TEE_ERROR_BAD_PARAMETERS; in hkdf_expand()
118 res = crypto_mac_init(ctx, prk, prk_len); in hkdf_expand()
119 if (res != TEE_SUCCESS) in hkdf_expand()
121 res = crypto_mac_update(ctx, tn, tn_len); in hkdf_expand()
122 if (res != TEE_SUCCESS) in hkdf_expand()
124 res = crypto_mac_update(ctx, info, info_len); in hkdf_expand()
125 if (res != TEE_SUCCESS) in hkdf_expand()
127 res = crypto_mac_update(ctx, &c, 1); in hkdf_expand()
128 if (res != TEE_SUCCESS) in hkdf_expand()
130 res = crypto_mac_final(ctx, tn, sizeof(tn)); in hkdf_expand()
131 if (res != TEE_SUCCESS) in hkdf_expand()
141 return res; in hkdf_expand()
149 TEE_Result res; in tee_cryp_hkdf() local
153 res = hkdf_extract(hash_id, ikm, ikm_len, salt, salt_len, prk, in tee_cryp_hkdf()
155 if (res != TEE_SUCCESS) in tee_cryp_hkdf()
156 return res; in tee_cryp_hkdf()
157 res = hkdf_expand(hash_id, prk, prk_len, info, info_len, okm, in tee_cryp_hkdf()
160 return res; in tee_cryp_hkdf()