const uint8_t *iv = tdata->iv.data;
const uint8_t iv_len = tdata->iv.len;
const unsigned int cipher_len = tdata->validCipherLenInBits.len;
- const unsigned int cipher_offset =
- tdata->validCipherOffsetLenInBits.len;
+ const unsigned int cipher_offset = tdata->iv.len << 3;
const unsigned int auth_len = tdata->validAuthLenInBits.len;
- const unsigned int auth_offset = tdata->validAuthOffsetLenInBits.len;
+ const unsigned int auth_offset = tdata->aad.len << 3;
unsigned int iv_pad_len = 0;
unsigned int aad_buffer_len;
plaintext_pad_len, RTE_CRYPTO_AUTH_OP_GENERATE,
RTE_CRYPTO_AUTH_SNOW3G_UIA2,
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len);
+ (tdata->aad.len << 3));
if (retval < 0)
return retval;
RTE_CRYPTO_AUTH_OP_VERIFY,
RTE_CRYPTO_AUTH_SNOW3G_UIA2,
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len);
+ (tdata->aad.len << 3));
if (retval < 0)
return retval;
plaintext_pad_len, RTE_CRYPTO_AUTH_OP_GENERATE,
RTE_CRYPTO_AUTH_KASUMI_F9,
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len);
+ (tdata->aad.len << 3));
if (retval < 0)
return retval;
RTE_CRYPTO_AUTH_OP_VERIFY,
RTE_CRYPTO_AUTH_KASUMI_F9,
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len);
+ (tdata->aad.len << 3));
if (retval < 0)
return retval;
/* Create KASUMI operation */
retval = create_wireless_algo_cipher_operation(tdata->iv.data, tdata->iv.len,
tdata->plaintext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_KASUMI_F8);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation(tdata->iv.data,
tdata->iv.len,
tdata->plaintext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_KASUMI_F8);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
tdata->plaintext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_KASUMI_F8);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
tdata->plaintext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_KASUMI_F8);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
tdata->ciphertext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_KASUMI_F8);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation(tdata->iv.data,
tdata->iv.len,
tdata->ciphertext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_KASUMI_F8);
if (retval < 0)
return retval;
/* Create SNOW 3G operation */
retval = create_wireless_algo_cipher_operation(tdata->iv.data, tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_SNOW3G_UEA2);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_SNOW3G_UEA2);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_SNOW3G_UEA2);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len +
+ (tdata->iv.len << 3) +
extra_offset,
RTE_CRYPTO_CIPHER_SNOW3G_UEA2);
if (retval < 0)
/* Create SNOW 3G operation */
retval = create_wireless_algo_cipher_operation(tdata->iv.data, tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_SNOW3G_UEA2);
if (retval < 0)
return retval;
retval = create_wireless_algo_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_SNOW3G_UEA2);
if (retval < 0)
return retval;
RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
tdata->iv.data, tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len
+ (tdata->aad.len << 3)
);
if (retval < 0)
return retval;
tdata->aad.data, tdata->aad.len,
plaintext_pad_len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len,
+ (tdata->aad.len << 3),
RTE_CRYPTO_AUTH_SNOW3G_UIA2,
RTE_CRYPTO_CIPHER_SNOW3G_UEA2
);
tdata->aad.data, tdata->aad.len,
plaintext_pad_len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len,
+ (tdata->aad.len << 3),
RTE_CRYPTO_AUTH_KASUMI_F9,
RTE_CRYPTO_CIPHER_KASUMI_F8
);
RTE_CRYPTO_CIPHER_KASUMI_F8,
tdata->iv.data, tdata->iv.len,
tdata->validCipherLenInBits.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len
+ (tdata->aad.len << 3)
);
if (retval < 0)
return retval;
/* Create ZUC operation */
retval = create_wireless_algo_cipher_operation(tdata->iv.data, tdata->iv.len,
tdata->plaintext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_ZUC_EEA3);
if (retval < 0)
return retval;
/* Create ZUC operation */
retval = create_wireless_algo_cipher_operation(tdata->iv.data,
tdata->iv.len, tdata->plaintext.len,
- tdata->validCipherOffsetLenInBits.len,
+ (tdata->iv.len << 3),
RTE_CRYPTO_CIPHER_ZUC_EEA3);
if (retval < 0)
return retval;
plaintext_pad_len, RTE_CRYPTO_AUTH_OP_GENERATE,
RTE_CRYPTO_AUTH_ZUC_EIA3,
tdata->validAuthLenInBits.len,
- tdata->validAuthOffsetLenInBits.len);
+ (tdata->aad.len << 3));
if (retval < 0)
return retval;
unsigned len;
} validCipherLenInBits;
- struct {
- unsigned len;
- } validCipherOffsetLenInBits;
-
struct {
unsigned len;
} validAuthLenInBits;
- struct {
- unsigned len;
- } validAuthOffsetLenInBits;
-
struct {
uint8_t data[64];
unsigned len;
.validCipherLenInBits = {
.len = 800
},
- .validCipherOffsetLenInBits = {
- .len = 128
- },
.aad = {
.data = {
0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00,
.validCipherLenInBits = {
.len = 512
},
- .validCipherOffsetLenInBits = {
- .len = 128
- },
.aad = {
.data = {
0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00,
.validCipherLenInBits = {
.len = 120
},
- .validCipherOffsetLenInBits = {
- .len = 128
- },
.aad = {
.data = {
0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00,
},
.validAuthLenInBits = {
.len = 120
- },
- .validAuthOffsetLenInBits = {
- .len = 128
}
};
},
.validCipherLenInBits = {
.len = 256
- },
- .validCipherOffsetLenInBits = {
- .len = 128
}
};
.validCipherLenInBits = {
.len = 840
},
- .validCipherOffsetLenInBits = {
- .len = 128
- }
};
struct snow3g_test_data snow3g_test_case_6 = {
.key = {
.validCipherLenInBits = {
.len = 384
},
- .validCipherOffsetLenInBits = {
- .len = 128
- },
.validAuthLenInBits = {
.len = 384
},
- .validAuthOffsetLenInBits = {
- .len = 128
- }
};
#endif /* TEST_CRYPTODEV_SNOW3G_TEST_VECTORS_H_ */
unsigned len;
} validCipherLenInBits;
- struct {
- unsigned len;
- } validCipherOffsetLenInBits;
-
struct {
unsigned len;
} validAuthLenInBits;
- struct {
- unsigned len;
- } validAuthOffsetLenInBits;
-
struct {
uint8_t data[64];
unsigned len;
},
.validCipherLenInBits = {
.len = 193
- },
- .validCipherOffsetLenInBits = {
- .len = 128
}
};
},
.validCipherLenInBits = {
.len = 800
- },
- .validCipherOffsetLenInBits = {
- .len = 128
}
};
},
.validCipherLenInBits = {
.len = 1570
- },
- .validCipherOffsetLenInBits = {
- .len = 128
- },
+ }
};
static struct wireless_test_data zuc_test_case_cipher_2798b = {
},
.validCipherLenInBits = {
.len = 2798
- },
- .validCipherOffsetLenInBits = {
- .len = 128
}
};
},
.validCipherLenInBits = {
.len = 4019
- },
- .validCipherOffsetLenInBits = {
- .len = 128
}
};
.validCipherLenInBits = {
.len = 200
},
- .validCipherOffsetLenInBits = {
- .len = 128
- },
.aad = {
.data = {
0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00,
},
.validAuthLenInBits = {
.len = 200
- },
- .validAuthOffsetLenInBits = {
- .len = 128
}
};
.validCipherLenInBits = {
.len = 800
},
- .validCipherOffsetLenInBits = {
- .len = 128
- },
.aad = {
.data = {
0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00,
},
.validAuthLenInBits = {
.len = 120
- },
- .validAuthOffsetLenInBits = {
- .len = 128
}
};
.validAuthLenInBits = {
.len = 1
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = {0xC8, 0xA9, 0x59, 0x5E},
.len = 4
.validAuthLenInBits = {
.len = 90
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = {0x67, 0x19, 0xA0, 0x88},
.len = 4
.validAuthLenInBits = {
.len = 577
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = {0xFA, 0xE8, 0xFF, 0x0B},
.len = 4
.validAuthLenInBits = {
.len = 2079
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = {0x00, 0x4A, 0xC4, 0xD6},
.len = 4
.validAuthLenInBits = {
.len = 5670
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = {0x0C, 0xA1, 0x27, 0x92},
.len = 4
.validAuthLenInBits = {
.len = 8
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = { 0x39, 0x0a, 0x91, 0xb7 },
.len = 4
.validAuthLenInBits = {
.len = 2080
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = {0x03, 0x95, 0x32, 0xe1},
.len = 4
.validAuthLenInBits = {
.len = 584
},
- .validAuthOffsetLenInBits = {
- .len = 128
- },
.digest = {
.data = {0x24, 0xa8, 0x42, 0xb3},
.len = 4