| 817 | } |
| 818 | |
| 819 | static int |
| 820 | crosscheck_all_devices(const struct crosscheck_test_profile *profile, enum crypto_op_type op_type, |
| 821 | const uint8_t *input_text, uint16_t input_len, uint8_t *output_text, |
| 822 | uint16_t *output_len) |
| 823 | { |
| 824 | struct crosscheck_testsuite_params *ts_params = &testsuite_params; |
| 825 | uint16_t len = 0, expected_len = 0; |
| 826 | uint8_t expected_text[MBUF_SIZE]; |
| 827 | uint8_t i, dev_id; |
| 828 | int status; |
| 829 | |
| 830 | |
| 831 | for (i = 0; i < ts_params->valid_dev_count; i++) { |
| 832 | dev_id = ts_params->valid_devs[i]; |
| 833 | status = single_dev_process(profile, dev_id, op_type, input_text, input_len, |
| 834 | output_text, &len); |
| 835 | TEST_ASSERT_SUCCESS(status, "Error occurred during processing"); |
| 836 | |
| 837 | if (i == 0) { |
| 838 | /* First device, copy data for future comparisons */ |
| 839 | memcpy(expected_text, output_text, len); |
| 840 | memcpy(ts_params->expected_digest.mem, ts_params->digest.mem, |
| 841 | profile->digest_size); |
| 842 | memcpy(ts_params->expected_aad.mem, ts_params->aad.mem, profile->aad_size); |
| 843 | expected_len = len; |
| 844 | } else { |
| 845 | /* Compare output against expected(first) output */ |
| 846 | TEST_ASSERT_SUCCESS(buffers_compare(expected_text, expected_len, |
| 847 | output_text, len), |
| 848 | "Text mismatch occurred on dev %i\n", dev_id); |
| 849 | TEST_ASSERT_SUCCESS(buffers_compare(ts_params->expected_digest.mem, |
| 850 | profile->digest_size, ts_params->digest.mem, |
| 851 | profile->digest_size), |
| 852 | "Digest mismatch occurred on dev %i\n", dev_id); |
| 853 | TEST_ASSERT_SUCCESS(buffers_compare(ts_params->expected_aad.mem, |
| 854 | profile->aad_size, ts_params->aad.mem, profile->aad_size), |
| 855 | "AAD mismatch occurred on dev %i\n", dev_id); |
| 856 | } |
| 857 | |
| 858 | RTE_LOG(DEBUG, USER1, "DEV ID: %u finished processing\n", dev_id); |
| 859 | debug_hexdump(stdout, "Output: ", output_text, len); |
| 860 | if (profile->digest_size) |
| 861 | debug_hexdump(stdout, "Digest: ", ts_params->digest.mem, |
| 862 | profile->digest_size); |
| 863 | } |
| 864 | |
| 865 | *output_len = len; |
| 866 | |
| 867 | return TEST_SUCCESS; |
| 868 | } |
| 869 | |
| 870 | static int |
| 871 | check_negative_all_devices(const struct crosscheck_test_profile *profile, |
no test coverage detected