Lines Matching refs:info
25 FILE *fp = info.fp_rd; in get_file_line()
26 char *line = info.one_line_text; in get_file_line()
54 for (i = 0; i < info.nb_vec_lines; i++) { in fips_test_fetch_one_block()
55 free(info.vec[i]); in fips_test_fetch_one_block()
56 info.vec[i] = NULL; in fips_test_fetch_one_block()
67 size = strlen(info.one_line_text); in fips_test_fetch_one_block()
71 info.vec[i] = calloc(1, size + 5); in fips_test_fetch_one_block()
72 if (info.vec[i] == NULL) in fips_test_fetch_one_block()
75 strlcpy(info.vec[i], info.one_line_text, size + 1); in fips_test_fetch_one_block()
79 info.nb_vec_lines = i; in fips_test_fetch_one_block()
85 if (info.vec[i] != NULL) { in fips_test_fetch_one_block()
86 free(info.vec[i]); in fips_test_fetch_one_block()
87 info.vec[i] = NULL; in fips_test_fetch_one_block()
90 info.nb_vec_lines = 0; in fips_test_fetch_one_block()
98 int len = strlen(info.vec[0]); in fips_test_parse_version()
99 char *ptr = info.vec[0]; in fips_test_parse_version()
101 info.version = strtof(ptr + len - 4, NULL); in fips_test_parse_version()
118 if (info.nb_vec_lines) in fips_test_parse_header()
121 for (i = 0; i < info.nb_vec_lines; i++) { in fips_test_parse_header()
123 if (strstr(info.vec[i], "AESVS")) { in fips_test_parse_header()
125 info.algo = FIPS_TEST_ALGO_AES; in fips_test_parse_header()
129 } else if (strstr(info.vec[i], "GCM")) { in fips_test_parse_header()
131 info.algo = FIPS_TEST_ALGO_AES_GCM; in fips_test_parse_header()
135 } else if (strstr(info.vec[i], "CMAC")) { in fips_test_parse_header()
137 info.algo = FIPS_TEST_ALGO_AES_CMAC; in fips_test_parse_header()
141 } else if (strstr(info.vec[i], "CCM")) { in fips_test_parse_header()
143 info.algo = FIPS_TEST_ALGO_AES_CCM; in fips_test_parse_header()
147 } else if (strstr(info.vec[i], "HMAC")) { in fips_test_parse_header()
149 info.algo = FIPS_TEST_ALGO_HMAC; in fips_test_parse_header()
153 } else if (strstr(info.vec[i], "TDES")) { in fips_test_parse_header()
155 info.algo = FIPS_TEST_ALGO_TDES; in fips_test_parse_header()
159 } else if (strstr(info.vec[i], "PERMUTATION")) { in fips_test_parse_header()
161 info.algo = FIPS_TEST_ALGO_TDES; in fips_test_parse_header()
165 } else if (strstr(info.vec[i], "VARIABLE")) { in fips_test_parse_header()
167 info.algo = FIPS_TEST_ALGO_TDES; in fips_test_parse_header()
171 } else if (strstr(info.vec[i], "SUBSTITUTION")) { in fips_test_parse_header()
173 info.algo = FIPS_TEST_ALGO_TDES; in fips_test_parse_header()
177 } else if (strstr(info.vec[i], "SHA-")) { in fips_test_parse_header()
179 info.algo = FIPS_TEST_ALGO_SHA; in fips_test_parse_header()
183 } else if (strstr(info.vec[i], "XTS")) { in fips_test_parse_header()
185 info.algo = FIPS_TEST_ALGO_AES_XTS; in fips_test_parse_header()
192 tmp = strstr(info.vec[i], "# Config info for "); in fips_test_parse_header()
194 fprintf(info.fp_wr, "%s%s\n", "# Config info for DPDK Cryptodev ", in fips_test_parse_header()
195 info.device_name); in fips_test_parse_header()
199 tmp = strstr(info.vec[i], "# HMAC information for "); in fips_test_parse_header()
201 fprintf(info.fp_wr, "%s%s\n", "# HMAC information for " in fips_test_parse_header()
203 info.device_name); in fips_test_parse_header()
207 tmp = strstr(info.vec[i], "# Config Info for : "); in fips_test_parse_header()
210 fprintf(info.fp_wr, "%s%s\n", "# Config Info for DPDK Cryptodev : ", in fips_test_parse_header()
211 info.device_name); in fips_test_parse_header()
215 tmp = strstr(info.vec[i], "# information for "); in fips_test_parse_header()
220 strlcpy(tmp_output, info.vec[i], tmp - info.vec[i] + 1); in fips_test_parse_header()
222 fprintf(info.fp_wr, "%s%s%s\n", tmp_output, in fips_test_parse_header()
224 info.device_name); in fips_test_parse_header()
228 tmp = strstr(info.vec[i], " test information for "); in fips_test_parse_header()
232 strlcpy(tmp_output, info.vec[i], tmp - info.vec[i] + 1); in fips_test_parse_header()
234 fprintf(info.fp_wr, "%s%s%s\n", tmp_output, in fips_test_parse_header()
236 info.device_name); in fips_test_parse_header()
240 tmp = strstr(info.vec[i], "\" information for \""); in fips_test_parse_header()
244 strlcpy(tmp_output, info.vec[i], tmp - info.vec[i] + 1); in fips_test_parse_header()
246 fprintf(info.fp_wr, "%s%s%s\n", tmp_output, in fips_test_parse_header()
248 info.device_name); in fips_test_parse_header()
252 if (i == info.nb_vec_lines - 1) { in fips_test_parse_header()
254 fprintf(info.fp_wr, "%s%s\n", "# Generated on ", in fips_test_parse_header()
262 fprintf(info.fp_wr, "%s\n", info.vec[i]); in fips_test_parse_header()
274 info.file_type = FIPS_TYPE_REQ; in parse_file_type()
276 info.file_type = FIPS_TYPE_RSP; in parse_file_type()
278 info.file_type = FIPS_TYPE_FAX; in parse_file_type()
296 if (rte_strscpy(info.file_name, req_file_path, in fips_test_init()
297 sizeof(info.file_name)) < 0) { in fips_test_init()
301 info.algo = FIPS_TEST_ALGO_MAX; in fips_test_init()
308 info.fp_rd = fopen(req_file_path, "r"); in fips_test_init()
309 if (!info.fp_rd) { in fips_test_init()
314 info.fp_wr = fopen(rsp_file_path, "w"); in fips_test_init()
315 if (!info.fp_wr) { in fips_test_init()
320 info.one_line_text = calloc(1, MAX_LINE_CHAR); in fips_test_init()
321 if (!info.one_line_text) { in fips_test_init()
326 if (rte_strscpy(info.device_name, device_name, in fips_test_init()
327 sizeof(info.device_name)) < 0) { in fips_test_init()
343 if (info.fp_rd) in fips_test_clear()
344 fclose(info.fp_rd); in fips_test_clear()
345 if (info.fp_wr) in fips_test_clear()
346 fclose(info.fp_wr); in fips_test_clear()
347 if (info.one_line_text) in fips_test_clear()
348 free(info.one_line_text); in fips_test_clear()
349 if (info.nb_vec_lines) { in fips_test_clear()
352 for (i = 0; i < info.nb_vec_lines; i++) in fips_test_clear()
353 free(info.vec[i]); in fips_test_clear()
356 memset(&info, 0, sizeof(info)); in fips_test_clear()
367 info.vec_start_off = 0; in fips_test_parse_one_case()
369 if (info.interim_callbacks) { in fips_test_parse_one_case()
370 for (i = 0; i < info.nb_vec_lines; i++) { in fips_test_parse_one_case()
372 for (j = 0; info.interim_callbacks[j].key != NULL; j++) in fips_test_parse_one_case()
373 if (strstr(info.vec[i], in fips_test_parse_one_case()
374 info.interim_callbacks[j].key)) { in fips_test_parse_one_case()
377 ret = info.interim_callbacks[j].cb( in fips_test_parse_one_case()
378 info.interim_callbacks[j].key, in fips_test_parse_one_case()
379 info.vec[i], in fips_test_parse_one_case()
380 info.interim_callbacks[j].val); in fips_test_parse_one_case()
391 if (info.version == 21.4f) { in fips_test_parse_one_case()
393 fprintf(info.fp_wr, "%s\n", info.vec[i]); in fips_test_parse_one_case()
394 fprintf(info.fp_wr, "\n"); in fips_test_parse_one_case()
396 if (info.nb_vec_lines == interim_cnt) in fips_test_parse_one_case()
399 for (i = 0; i < info.nb_vec_lines; i++) in fips_test_parse_one_case()
400 fprintf(info.fp_wr, "%s\n", info.vec[i]); in fips_test_parse_one_case()
401 fprintf(info.fp_wr, "\n"); in fips_test_parse_one_case()
406 info.vec_start_off = interim_cnt; in fips_test_parse_one_case()
408 for (i = info.vec_start_off; i < info.nb_vec_lines; i++) { in fips_test_parse_one_case()
409 for (j = 0; info.callbacks[j].key != NULL; j++) in fips_test_parse_one_case()
410 if (strstr(info.vec[i], info.callbacks[j].key)) { in fips_test_parse_one_case()
411 ret = info.callbacks[j].cb( in fips_test_parse_one_case()
412 info.callbacks[j].key, in fips_test_parse_one_case()
413 info.vec[i], info.callbacks[j].val); in fips_test_parse_one_case()
428 for (i = info.vec_start_off; i < info.nb_vec_lines; i++) in fips_test_write_one_case()
429 fprintf(info.fp_wr, "%s\n", info.vec[i]); in fips_test_write_one_case()
656 writeback_hex_str("", info.one_line_text, src); in parse_write_hex_str()
658 fprintf(info.fp_wr, "%s\n", info.one_line_text); in parse_write_hex_str()
667 if (!info.writeback_callbacks) in update_info_vec()
670 cb = &info.writeback_callbacks[0]; in update_info_vec()
672 if ((info.version == 21.4f) && (!(strstr(info.vec[0], cb->key)))) { in update_info_vec()
673 fprintf(info.fp_wr, "%s%u\n", cb->key, count); in update_info_vec()
676 snprintf(info.vec[0], strlen(info.vec[0]) + 4, "%s%u", cb->key, in update_info_vec()
681 for (; i < info.nb_vec_lines; i++) { in update_info_vec()
682 for (j = 1; info.writeback_callbacks[j].key != NULL; j++) { in update_info_vec()
683 cb = &info.writeback_callbacks[j]; in update_info_vec()
684 if (strstr(info.vec[i], cb->key)) { in update_info_vec()
685 cb->cb(cb->key, info.vec[i], cb->val); in update_info_vec()