examples/l3fwd-power: add Rx interrupt timeout
[dpdk.git] / examples / fips_validation / fips_validation_tdes.c
index 15ee434..84dd288 100644 (file)
@@ -12,6 +12,7 @@
 
 #define NEW_LINE_STR   "#"
 #define TEST_TYPE_KEY  " for CBC"
+#define TEST_TYPE_ECB_KEY      " for ECB"
 #define TEST_CBCI_KEY  " for CBCI"
 
 #define ENC_STR                "[ENCRYPT]"
@@ -59,7 +60,7 @@ parse_tdes_uint8_hex_str(const char *key, char *src, struct fips_val *val);
 
 static int
 parse_tdes_interim(const char *key,
-               __attribute__((__unused__)) char *text,
+               __rte_unused char *text,
                struct fips_val *val);
 
 struct fips_test_callback tdes_tests_vectors[] = {
@@ -94,8 +95,8 @@ struct fips_test_callback tdes_writeback_callbacks[] = {
 
 static int
 parse_tdes_interim(const char *key,
-               __attribute__((__unused__)) char *text,
-               __attribute__((__unused__)) struct fips_val *val)
+               __rte_unused char *text,
+               __rte_unused struct fips_val *val)
 {
        if (strstr(key, ENC_STR))
                info.op = FIPS_TEST_ENC_AUTH_GEN;
@@ -212,6 +213,8 @@ writeback_tdes_hex_str(const char *key, char *dst, struct fips_val *val)
                tmp_val.val = val->val + 8;
        else if (strstr(key, KEY3_STR))
                tmp_val.val = val->val + 16;
+       else
+               return -EINVAL;
 
        return writeback_hex_str(key, dst, &tmp_val);
 }
@@ -250,6 +253,12 @@ parse_test_tdes_init(void)
                        if (strstr(line, test_types[j].desc)) {
                                info.interim_info.tdes_data.test_type =
                                                test_types[j].type;
+                               if (strstr(line, TEST_TYPE_ECB_KEY))
+                                       info.interim_info.tdes_data.test_mode =
+                                               TDES_MODE_ECB;
+                               else
+                                       info.interim_info.tdes_data.test_mode =
+                                               TDES_MODE_CBC;
                                break;
                        }
        }