Lines Matching refs:attr

517 	TEE_Result (*from_user)(void *attr, const void *buffer, size_t size);
518 TEE_Result (*to_user)(void *attr, struct ts_session *sess,
520 TEE_Result (*to_binary)(void *attr, void *data, size_t data_len,
522 bool (*from_binary)(void *attr, const void *data, size_t data_len,
524 TEE_Result (*from_obj)(void *attr, void *src_attr);
525 void (*free)(void *attr);
526 void (*clear)(void *attr);
561 static TEE_Result op_attr_secret_value_from_user(void *attr, const void *buffer, in op_attr_secret_value_from_user() argument
564 struct tee_cryp_obj_secret *key = attr; in op_attr_secret_value_from_user()
574 static TEE_Result op_attr_secret_value_to_user(void *attr, in op_attr_secret_value_to_user() argument
579 struct tee_cryp_obj_secret *key = attr; in op_attr_secret_value_to_user()
598 static TEE_Result op_attr_secret_value_to_binary(void *attr, void *data, in op_attr_secret_value_to_binary() argument
602 struct tee_cryp_obj_secret *key = attr; in op_attr_secret_value_to_binary()
619 static bool op_attr_secret_value_from_binary(void *attr, const void *data, in op_attr_secret_value_from_binary() argument
622 struct tee_cryp_obj_secret *key = attr; in op_attr_secret_value_from_binary()
641 static TEE_Result op_attr_secret_value_from_obj(void *attr, void *src_attr) in op_attr_secret_value_from_obj() argument
643 struct tee_cryp_obj_secret *key = attr; in op_attr_secret_value_from_obj()
653 static void op_attr_secret_value_clear(void *attr) in op_attr_secret_value_clear() argument
655 struct tee_cryp_obj_secret *key = attr; in op_attr_secret_value_clear()
661 static TEE_Result op_attr_bignum_from_user(void *attr, const void *buffer, in op_attr_bignum_from_user() argument
664 struct bignum **bn = attr; in op_attr_bignum_from_user()
669 static TEE_Result op_attr_bignum_to_user(void *attr, in op_attr_bignum_to_user() argument
674 struct bignum **bn = attr; in op_attr_bignum_to_user()
707 static TEE_Result op_attr_bignum_to_binary(void *attr, void *data, in op_attr_bignum_to_binary() argument
711 struct bignum **bn = attr; in op_attr_bignum_to_binary()
729 static bool op_attr_bignum_from_binary(void *attr, const void *data, in op_attr_bignum_from_binary() argument
732 struct bignum **bn = attr; in op_attr_bignum_from_binary()
746 static TEE_Result op_attr_bignum_from_obj(void *attr, void *src_attr) in op_attr_bignum_from_obj() argument
748 struct bignum **bn = attr; in op_attr_bignum_from_obj()
755 static void op_attr_bignum_clear(void *attr) in op_attr_bignum_clear() argument
757 struct bignum **bn = attr; in op_attr_bignum_clear()
762 static void op_attr_bignum_free(void *attr) in op_attr_bignum_free() argument
764 struct bignum **bn = attr; in op_attr_bignum_free()
770 static TEE_Result op_attr_value_from_user(void *attr, const void *buffer, in op_attr_value_from_user() argument
773 uint32_t *v = attr; in op_attr_value_from_user()
783 static TEE_Result op_attr_value_to_user(void *attr, in op_attr_value_to_user() argument
788 uint32_t *v = attr; in op_attr_value_to_user()
803 static TEE_Result op_attr_value_to_binary(void *attr, void *data, in op_attr_value_to_binary() argument
806 uint32_t *v = attr; in op_attr_value_to_binary()
811 static bool op_attr_value_from_binary(void *attr, const void *data, in op_attr_value_from_binary() argument
814 uint32_t *v = attr; in op_attr_value_from_binary()
819 static TEE_Result op_attr_value_from_obj(void *attr, void *src_attr) in op_attr_value_from_obj() argument
821 uint32_t *v = attr; in op_attr_value_from_obj()
828 static void op_attr_value_clear(void *attr) in op_attr_value_clear() argument
830 uint32_t *v = attr; in op_attr_value_clear()
950 uint32_t attr) in set_attribute() argument
952 int idx = tee_svc_cryp_obj_find_type_attr_idx(attr, props); in set_attribute()
962 uint32_t attr) in get_attribute() argument
964 int idx = tee_svc_cryp_obj_find_type_attr_idx(attr, props); in get_attribute()
980 void *attr = NULL; in syscall_cryp_obj_get_attr() local
1006 attr = (uint8_t *)o->attr + type_props->type_attrs[idx].raw_offs; in syscall_cryp_obj_get_attr()
1007 return ops->to_user(attr, sess, buffer, size); in syscall_cryp_obj_get_attr()
1015 if (!o->attr) in tee_obj_attr_free()
1024 attr_ops[ta->ops_index].free((uint8_t *)o->attr + ta->raw_offs); in tee_obj_attr_free()
1033 if (!o->attr) in tee_obj_attr_clear()
1042 attr_ops[ta->ops_index].clear((uint8_t *)o->attr + in tee_obj_attr_clear()
1060 if (!o->attr) in tee_obj_attr_to_binary()
1068 void *attr = (uint8_t *)o->attr + ta->raw_offs; in tee_obj_attr_to_binary() local
1070 res = attr_ops[ta->ops_index].to_binary(attr, data, len, &offs); in tee_obj_attr_to_binary()
1090 if (!o->attr) in tee_obj_attr_from_binary()
1098 void *attr = (uint8_t *)o->attr + ta->raw_offs; in tee_obj_attr_from_binary() local
1100 if (!attr_ops[ta->ops_index].from_binary(attr, data, data_len, in tee_obj_attr_from_binary()
1114 void *attr; in tee_obj_attr_copy_from() local
1119 if (!o->attr) in tee_obj_attr_copy_from()
1129 attr = (uint8_t *)o->attr + ta->raw_offs; in tee_obj_attr_copy_from()
1130 src_attr = (uint8_t *)src->attr + ta->raw_offs; in tee_obj_attr_copy_from()
1131 res = attr_ops[ta->ops_index].from_obj(attr, src_attr); in tee_obj_attr_copy_from()
1177 attr = (uint8_t *)o->attr + ta->raw_offs; in tee_obj_attr_copy_from()
1178 src_attr = (uint8_t *)src->attr + in tee_obj_attr_copy_from()
1180 res = attr_ops[ta->ops_index].from_obj(attr, src_attr); in tee_obj_attr_copy_from()
1227 if (o->attr) in tee_obj_set_type()
1249 o->attr = calloc(1, type_props->alloc_size); in tee_obj_set_type()
1250 if (!o->attr) in tee_obj_set_type()
1257 res = crypto_acipher_alloc_rsa_public_key(o->attr, in tee_obj_set_type()
1261 res = crypto_acipher_alloc_rsa_keypair(o->attr, max_key_size); in tee_obj_set_type()
1264 res = crypto_acipher_alloc_dsa_public_key(o->attr, in tee_obj_set_type()
1268 res = crypto_acipher_alloc_dsa_keypair(o->attr, max_key_size); in tee_obj_set_type()
1271 res = crypto_acipher_alloc_dh_keypair(o->attr, max_key_size); in tee_obj_set_type()
1278 res = crypto_acipher_alloc_ecc_public_key(o->attr, obj_type, in tee_obj_set_type()
1286 res = crypto_acipher_alloc_ecc_keypair(o->attr, obj_type, in tee_obj_set_type()
1291 struct tee_cryp_obj_secret *key = o->attr; in tee_obj_set_type()
1559 void *attr = NULL; in tee_svc_cryp_obj_populate_type() local
1571 attr = (uint8_t *)o->attr + in tee_svc_cryp_obj_populate_type()
1574 res = ops->from_user(attr, &attrs[n].content.value, in tee_svc_cryp_obj_populate_type()
1577 res = ops->from_user(attr, attrs[n].content.ref.buffer, in tee_svc_cryp_obj_populate_type()
1769 struct rsa_keypair *key = o->attr; in tee_svc_obj_generate_key_rsa()
1806 res = crypto_acipher_gen_dsa_key(o->attr, key_size); in tee_svc_obj_generate_key_dsa()
1831 tee_dh_key = (struct dh_keypair *)o->attr; in tee_svc_obj_generate_key_dh()
1861 tee_ecc_key = (struct ecc_keypair *)o->attr; in tee_svc_obj_generate_key_ecc()
1948 key = (struct tee_cryp_obj_secret *)o->attr; in syscall_obj_generate_key()
2378 key = (struct tee_cryp_obj_secret *)o->attr; in syscall_hash_init()
2562 key1 = o->attr; in syscall_cipher_init()
2565 struct tee_cryp_obj_secret *key2 = o->attr; in syscall_cipher_init()
2957 sk = so->attr; in syscall_cryp_derive_key()
2989 res = crypto_acipher_dh_shared_secret(ko->attr, in syscall_cryp_derive_key()
3043 key_public.curve = ((struct ecc_keypair *)ko->attr)->curve; in syscall_cryp_derive_key()
3053 res = crypto_acipher_ecc_shared_secret(ko->attr, &key_public, in syscall_cryp_derive_key()
3071 struct tee_cryp_obj_secret *ik = ko->attr; in syscall_cryp_derive_key()
3100 struct tee_cryp_obj_secret *ss = ko->attr; in syscall_cryp_derive_key()
3129 struct tee_cryp_obj_secret *ss = ko->attr; in syscall_cryp_derive_key()
3175 res = crypto_acipher_sm2_kep_derive(ko->attr, /* key1 */ in syscall_cryp_derive_key()
3176 ko2->attr, /* key2 */ in syscall_cryp_derive_key()
3242 key = o->attr; in syscall_authenc_init()
3584 res = crypto_acipher_rsanopad_encrypt(o->attr, src_data, in syscall_asymm_operate()
3588 res = crypto_acipher_rsanopad_decrypt(o->attr, src_data, in syscall_asymm_operate()
3602 res = crypto_acipher_sm2_pke_encrypt(o->attr, src_data, in syscall_asymm_operate()
3606 res = crypto_acipher_sm2_pke_decrypt(o->attr, src_data, in syscall_asymm_operate()
3629 res = crypto_acipher_rsaes_encrypt(cs->algo, o->attr, in syscall_asymm_operate()
3635 cs->algo, o->attr, label, label_len, in syscall_asymm_operate()
3661 res = crypto_acipher_rsassa_sign(cs->algo, o->attr, salt_len, in syscall_asymm_operate()
3669 res = crypto_acipher_dsa_sign(cs->algo, o->attr, src_data, in syscall_asymm_operate()
3678 res = crypto_acipher_ecc_sign(cs->algo, o->attr, src_data, in syscall_asymm_operate()
3768 res = crypto_acipher_rsassa_verify(cs->algo, o->attr, salt_len, in syscall_asymm_verify()
3780 struct dsa_public_key *key = o->attr; in syscall_asymm_verify()
3811 res = crypto_acipher_dsa_verify(cs->algo, o->attr, data, in syscall_asymm_verify()
3817 res = crypto_acipher_ecc_verify(cs->algo, o->attr, data, in syscall_asymm_verify()