#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]"
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[] = {
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;
static int
writeback_tdes_hex_str(const char *key, char *dst, struct fips_val *val)
{
- struct fips_val tmp_val;
+ struct fips_val tmp_val = {0};
tmp_val.len = 8;
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);
}
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;
}
}