Lines Matching refs:i
171 size_t i; in find_cipher_data_index() local
173 for (i = 0; i < OSSL_NELEM(cipher_data); i++) in find_cipher_data_index()
174 if (nid == cipher_data[i].nid) in find_cipher_data_index()
175 return i; in find_cipher_data_index()
181 size_t i = find_cipher_data_index(nid); in get_cipher_data_index() local
183 if (i != (size_t)-1) in get_cipher_data_index()
184 return i; in get_cipher_data_index()
428 size_t i; in prepare_cipher_methods() local
443 for (i = 0, known_cipher_nids_amount = 0; in prepare_cipher_methods()
444 i < OSSL_NELEM(cipher_data); i++) { in prepare_cipher_methods()
446 selected_ciphers[i] = 1; in prepare_cipher_methods()
450 sess.cipher = cipher_data[i].devcryptoid; in prepare_cipher_methods()
451 sess.keylen = cipher_data[i].keylen; in prepare_cipher_methods()
464 cipher_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION; in prepare_cipher_methods()
471 cipher_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION; in prepare_cipher_methods()
476 cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE; in prepare_cipher_methods()
478 if ((known_cipher_methods[i] = in prepare_cipher_methods()
479 EVP_CIPHER_meth_new(cipher_data[i].nid, in prepare_cipher_methods()
481 cipher_data[i].blocksize, in prepare_cipher_methods()
482 cipher_data[i].keylen)) == NULL in prepare_cipher_methods()
483 || !EVP_CIPHER_meth_set_iv_length(known_cipher_methods[i], in prepare_cipher_methods()
484 cipher_data[i].ivlen) in prepare_cipher_methods()
485 || !EVP_CIPHER_meth_set_flags(known_cipher_methods[i], in prepare_cipher_methods()
486 cipher_data[i].flags in prepare_cipher_methods()
490 || !EVP_CIPHER_meth_set_init(known_cipher_methods[i], cipher_init) in prepare_cipher_methods()
491 || !EVP_CIPHER_meth_set_do_cipher(known_cipher_methods[i], in prepare_cipher_methods()
495 || !EVP_CIPHER_meth_set_ctrl(known_cipher_methods[i], cipher_ctrl) in prepare_cipher_methods()
496 || !EVP_CIPHER_meth_set_cleanup(known_cipher_methods[i], in prepare_cipher_methods()
498 || !EVP_CIPHER_meth_set_impl_ctx_size(known_cipher_methods[i], in prepare_cipher_methods()
500 cipher_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE; in prepare_cipher_methods()
501 EVP_CIPHER_meth_free(known_cipher_methods[i]); in prepare_cipher_methods()
502 known_cipher_methods[i] = NULL; in prepare_cipher_methods()
504 cipher_driver_info[i].status = DEVCRYPTO_STATUS_USABLE; in prepare_cipher_methods()
506 cipher_driver_info[i].accelerated = accelerated; in prepare_cipher_methods()
509 cipher_driver_info[i].driver_name = in prepare_cipher_methods()
515 cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN; in prepare_cipher_methods()
517 cipher_driver_info[i].driver_name = in prepare_cipher_methods()
521 cipher_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED; in prepare_cipher_methods()
523 cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED; in prepare_cipher_methods()
528 if (devcrypto_test_cipher(i)) { in prepare_cipher_methods()
530 cipher_data[i].nid; in prepare_cipher_methods()
537 size_t i; in rebuild_known_cipher_nids() local
539 for (i = 0, known_cipher_nids_amount = 0; i < OSSL_NELEM(cipher_data); i++) { in rebuild_known_cipher_nids()
540 if (devcrypto_test_cipher(i)) in rebuild_known_cipher_nids()
541 known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid; in rebuild_known_cipher_nids()
549 size_t i = get_cipher_data_index(nid); in get_cipher_method() local
551 if (i == (size_t)-1) in get_cipher_method()
553 return known_cipher_methods[i]; in get_cipher_method()
564 size_t i = get_cipher_data_index(nid); in destroy_cipher_method() local
566 EVP_CIPHER_meth_free(known_cipher_methods[i]); in destroy_cipher_method()
567 known_cipher_methods[i] = NULL; in destroy_cipher_method()
572 size_t i; in destroy_all_cipher_methods() local
574 for (i = 0; i < OSSL_NELEM(cipher_data); i++) { in destroy_all_cipher_methods()
575 destroy_cipher_method(cipher_data[i].nid); in destroy_all_cipher_methods()
576 OPENSSL_free(cipher_driver_info[i].driver_name); in destroy_all_cipher_methods()
577 cipher_driver_info[i].driver_name = NULL; in destroy_all_cipher_methods()
594 size_t i; in devcrypto_select_all_ciphers() local
596 for (i = 0; i < OSSL_NELEM(cipher_data); i++) in devcrypto_select_all_ciphers()
597 cipher_list[i] = 1; in devcrypto_select_all_ciphers()
605 size_t i; in cryptodev_select_cipher_cb() local
614 else if ((i = find_cipher_data_index(EVP_CIPHER_get_nid(EVP))) != (size_t)-1) in cryptodev_select_cipher_cb()
615 cipher_list[i] = 1; in cryptodev_select_cipher_cb()
624 size_t i; in dump_cipher_info() local
632 for (i = 0; i < OSSL_NELEM(cipher_data); i++) { in dump_cipher_info()
633 name = OBJ_nid2sn(cipher_data[i].nid); in dump_cipher_info()
635 name ? name : "unknown", cipher_data[i].nid, in dump_cipher_info()
636 cipher_data[i].devcryptoid); in dump_cipher_info()
637 if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) { in dump_cipher_info()
641 fprintf (stderr, "driver=%s ", cipher_driver_info[i].driver_name ? in dump_cipher_info()
642 cipher_driver_info[i].driver_name : "unknown"); in dump_cipher_info()
643 if (cipher_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED) in dump_cipher_info()
645 else if (cipher_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED) in dump_cipher_info()
649 if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE) in dump_cipher_info()
713 size_t i; in find_digest_data_index() local
715 for (i = 0; i < OSSL_NELEM(digest_data); i++) in find_digest_data_index()
716 if (nid == digest_data[i].nid) in find_digest_data_index()
717 return i; in find_digest_data_index()
723 size_t i = find_digest_data_index(nid); in get_digest_data_index() local
725 if (i != (size_t)-1) in get_digest_data_index()
726 return i; in get_digest_data_index()
882 size_t i; in rebuild_known_digest_nids() local
884 for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data); i++) { in rebuild_known_digest_nids()
885 if (devcrypto_test_digest(i)) in rebuild_known_digest_nids()
886 known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid; in rebuild_known_digest_nids()
894 size_t i; in prepare_digest_methods() local
906 for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data); in prepare_digest_methods()
907 i++) { in prepare_digest_methods()
909 selected_digests[i] = 1; in prepare_digest_methods()
914 sess1.mac = digest_data[i].devcryptoid; in prepare_digest_methods()
917 digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION; in prepare_digest_methods()
925 digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN; in prepare_digest_methods()
927 digest_driver_info[i].driver_name = in prepare_digest_methods()
931 digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED; in prepare_digest_methods()
933 digest_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED; in prepare_digest_methods()
940 digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE; in prepare_digest_methods()
946 digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCCPHASH; in prepare_digest_methods()
949 if ((known_digest_methods[i] = EVP_MD_meth_new(digest_data[i].nid, in prepare_digest_methods()
951 || !EVP_MD_meth_set_input_blocksize(known_digest_methods[i], in prepare_digest_methods()
952 digest_data[i].blocksize) in prepare_digest_methods()
953 || !EVP_MD_meth_set_result_size(known_digest_methods[i], in prepare_digest_methods()
954 digest_data[i].digestlen) in prepare_digest_methods()
955 || !EVP_MD_meth_set_init(known_digest_methods[i], digest_init) in prepare_digest_methods()
956 || !EVP_MD_meth_set_update(known_digest_methods[i], digest_update) in prepare_digest_methods()
957 || !EVP_MD_meth_set_final(known_digest_methods[i], digest_final) in prepare_digest_methods()
958 || !EVP_MD_meth_set_copy(known_digest_methods[i], digest_copy) in prepare_digest_methods()
959 || !EVP_MD_meth_set_cleanup(known_digest_methods[i], digest_cleanup) in prepare_digest_methods()
960 || !EVP_MD_meth_set_app_datasize(known_digest_methods[i], in prepare_digest_methods()
962 digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE; in prepare_digest_methods()
963 EVP_MD_meth_free(known_digest_methods[i]); in prepare_digest_methods()
964 known_digest_methods[i] = NULL; in prepare_digest_methods()
967 digest_driver_info[i].status = DEVCRYPTO_STATUS_USABLE; in prepare_digest_methods()
972 if (devcrypto_test_digest(i)) in prepare_digest_methods()
973 known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid; in prepare_digest_methods()
979 size_t i = get_digest_data_index(nid); in get_digest_method() local
981 if (i == (size_t)-1) in get_digest_method()
983 return known_digest_methods[i]; in get_digest_method()
994 size_t i = get_digest_data_index(nid); in destroy_digest_method() local
996 EVP_MD_meth_free(known_digest_methods[i]); in destroy_digest_method()
997 known_digest_methods[i] = NULL; in destroy_digest_method()
1002 size_t i; in destroy_all_digest_methods() local
1004 for (i = 0; i < OSSL_NELEM(digest_data); i++) { in destroy_all_digest_methods()
1005 destroy_digest_method(digest_data[i].nid); in destroy_all_digest_methods()
1006 OPENSSL_free(digest_driver_info[i].driver_name); in destroy_all_digest_methods()
1007 digest_driver_info[i].driver_name = NULL; in destroy_all_digest_methods()
1024 size_t i; in devcrypto_select_all_digests() local
1026 for (i = 0; i < OSSL_NELEM(digest_data); i++) in devcrypto_select_all_digests()
1027 digest_list[i] = 1; in devcrypto_select_all_digests()
1035 size_t i; in cryptodev_select_digest_cb() local
1044 else if ((i = find_digest_data_index(EVP_MD_get_type(EVP))) != (size_t)-1) in cryptodev_select_digest_cb()
1045 digest_list[i] = 1; in cryptodev_select_digest_cb()
1054 size_t i; in dump_digest_info() local
1063 for (i = 0; i < OSSL_NELEM(digest_data); i++) { in dump_digest_info()
1064 name = OBJ_nid2sn(digest_data[i].nid); in dump_digest_info()
1066 name ? name : "unknown", digest_data[i].nid, in dump_digest_info()
1067 digest_data[i].devcryptoid, in dump_digest_info()
1068 digest_driver_info[i].driver_name ? digest_driver_info[i].driver_name : "unknown"); in dump_digest_info()
1069 if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) { in dump_digest_info()
1073 if (digest_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED) in dump_digest_info()
1075 else if (digest_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED) in dump_digest_info()
1079 if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE) in dump_digest_info()
1081 else if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCCPHASH) in dump_digest_info()
1135 static int devcrypto_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void)) in devcrypto_ctrl() argument
1141 switch (i) { in devcrypto_ctrl()
1147 fprintf(stderr, "devcrypto: invalid value (%ld) for USE_SOFTDRIVERS\n", i); in devcrypto_ctrl()
1150 if (use_softdrivers == i) in devcrypto_ctrl()
1152 use_softdrivers = i; in devcrypto_ctrl()