struct crypto_unittest_params *ut_params = &unittest_params;
memcpy(hash_key, key, key_len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "key:", key, key_len);
-#endif
+
+ TEST_HEXDUMP(stdout, "key:", key, key_len);
+
/* Setup Authentication Parameters */
ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
ut_params->auth_xform.next = NULL;
ut_params->cipher_xform.cipher.key.data = cipher_key;
ut_params->cipher_xform.cipher.key.length = key_len;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "key:", key, key_len);
-#endif
+ TEST_HEXDUMP(stdout, "key:", key, key_len);
+
/* Create Crypto session */
ut_params->sess = rte_cryptodev_sym_session_create(dev_id,
&ut_params->
ut_params->cipher_xform.cipher.key.data = cipher_auth_key;
ut_params->cipher_xform.cipher.key.length = key_len;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "key:", key, key_len);
-#endif
+ TEST_HEXDUMP(stdout, "key:", key, key_len);
+
/* Create Crypto session*/
ut_params->sess = rte_cryptodev_sym_session_create(dev_id,
&ut_params->cipher_xform);
ut_params->cipher_xform.cipher.key.data = auth_cipher_key;
ut_params->cipher_xform.cipher.key.length = key_len;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "key:", key, key_len);
-#endif
+ TEST_HEXDUMP(stdout, "key:", key, key_len);
+
/* Create Crypto session*/
ut_params->sess = rte_cryptodev_sym_session_create(dev_id,
&ut_params->auth_xform);
memset(sym_op->auth.aad.data, 0, aad_buffer_len);
rte_memcpy(sym_op->auth.aad.data, aad, aad_len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "aad:",
+ TEST_HEXDUMP(stdout, "aad:",
sym_op->auth.aad.data, aad_len);
-#endif
/* digest */
sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
else
rte_memcpy(sym_op->auth.digest.data, auth_tag, auth_tag_len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "digest:",
+ TEST_HEXDUMP(stdout, "digest:",
sym_op->auth.digest.data,
sym_op->auth.digest.length);
-#endif
sym_op->auth.data.length = auth_len;
sym_op->auth.data.offset = auth_offset;
memset(sym_op->auth.aad.data, 0, aad_buffer_len);
rte_memcpy(sym_op->auth.aad.data, aad, aad_len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "aad:",
+ TEST_HEXDUMP(stdout, "aad:",
sym_op->auth.aad.data, aad_len);
-#endif
/* digest */
sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
else
rte_memcpy(sym_op->auth.digest.data, auth_tag, auth_tag_len);
- #ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "digest:",
+ TEST_HEXDUMP(stdout, "digest:",
sym_op->auth.digest.data,
sym_op->auth.digest.length);
- #endif
sym_op->auth.data.length = auth_len;
sym_op->auth.data.offset = auth_offset;
memset(sym_op->auth.digest.data, 0, auth_tag_len);
- #ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "digest:",
+ TEST_HEXDUMP(stdout, "digest:",
sym_op->auth.digest.data,
sym_op->auth.digest.length);
- #endif
+
/* iv */
iv_pad_len = RTE_ALIGN_CEIL(iv_len, 16);
memset(sym_op->auth.aad.data, 0, aad_buffer_len);
rte_memcpy(sym_op->auth.aad.data, aad, aad_len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "aad:",
+ TEST_HEXDUMP(stdout, "aad:",
sym_op->auth.aad.data, aad_len);
-#endif
sym_op->cipher.data.length = cipher_len;
sym_op->cipher.data.offset = auth_offset + cipher_offset;
plaintext_pad_len);
memcpy(plaintext, tdata->plaintext.data, (tdata->plaintext.len >> 3));
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
+
/* Create SNOW3G operation */
retval = create_snow3g_cipher_operation(tdata->iv.data, tdata->iv.len,
tdata->validCipherLenInBits.len,
lastByteMask = lastByteMask << (8 - lastByteValidBits);
(*(ciphertext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ciphertext,
memcpy(plaintext, tdata->plaintext.data, (tdata->plaintext.len >> 3));
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
+
/* Create SNOW3G operation */
retval = create_snow3g_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
lastByteMask = lastByteMask << (8 - lastByteValidBits);
(*(ciphertext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ciphertext,
ciphertext_pad_len);
memcpy(ciphertext, tdata->ciphertext.data, tdata->ciphertext.len >> 3);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+
/* Create SNOW3G operation */
retval = create_snow3g_cipher_operation(tdata->iv.data, tdata->iv.len,
tdata->validCipherLenInBits.len,
lastByteMask = lastByteMask << (8 - lastByteValidBits);
(*(ciphertext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(plaintext,
tdata->plaintext.data,
memcpy(ciphertext, tdata->ciphertext.data, tdata->ciphertext.len >> 3);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+
/* Create SNOW3G operation */
retval = create_snow3g_cipher_operation_oop(tdata->iv.data,
tdata->iv.len,
lastByteMask = lastByteMask << (8 - lastByteValidBits);
(*(plaintext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(plaintext,
tdata->plaintext.data,
plaintext_pad_len);
memcpy(plaintext, tdata->plaintext.data, tdata->plaintext.len >> 3);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
/* Create SNOW3G operation */
retval = create_snow3g_cipher_hash_operation(tdata->digest.data,
lastByteMask = lastByteMask << (8-lastByteValidBits);
(*(ciphertext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ciphertext,
plaintext_pad_len);
memcpy(plaintext, tdata->plaintext.data, tdata->plaintext.len >> 3);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
/* Create SNOW3G operation */
retval = create_snow3g_auth_cipher_operation(
(*(ciphertext + (tdata->ciphertext.len >> 3) - 1)) &= lastByteMask;
ut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)
+ plaintext_pad_len + tdata->aad.len + tdata->iv.len;
- #ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ciphertext,
ut_params->cipher_xform.cipher.key.data = cipher_key;
ut_params->cipher_xform.cipher.key.length = key_len;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "key:", key, key_len);
-#endif
+ TEST_HEXDUMP(stdout, "key:", key, key_len);
+
/* Setup Authentication Parameters */
ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
ut_params->auth_xform.next = NULL;
if (op == RTE_CRYPTO_CIPHER_OP_DECRYPT) {
rte_memcpy(sym_op->auth.digest.data, auth_tag, auth_tag_len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "digest:",
+ TEST_HEXDUMP(stdout, "digest:",
sym_op->auth.digest.data,
sym_op->auth.digest.length);
-#endif
}
/* iv */
memset(sym_op->auth.aad.data, 0, aad_buffer_len);
rte_memcpy(sym_op->auth.aad.data, aad, aad_len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "iv:", sym_op->cipher.iv.data, iv_pad_len);
- rte_hexdump(stdout, "aad:",
+ TEST_HEXDUMP(stdout, "iv:", sym_op->cipher.iv.data, iv_pad_len);
+ TEST_HEXDUMP(stdout, "aad:",
sym_op->auth.aad.data, aad_len);
-#endif
+
sym_op->cipher.data.length = data_len;
sym_op->cipher.data.offset = aad_buffer_len + iv_pad_len;
plaintext_pad_len);
memcpy(plaintext, tdata->plaintext.data, tdata->plaintext.len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->plaintext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->plaintext.len);
+
/* Create GCM opertaion */
retval = create_gcm_operation(RTE_CRYPTO_CIPHER_OP_ENCRYPT,
tdata->auth_tag.data, tdata->auth_tag.len,
auth_tag = plaintext + plaintext_pad_len;
}
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
- rte_hexdump(stdout, "auth tag:", auth_tag, tdata->auth_tag.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+ TEST_HEXDUMP(stdout, "auth tag:", auth_tag, tdata->auth_tag.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(
ciphertext,
ciphertext_pad_len);
memcpy(ciphertext, tdata->ciphertext.data, tdata->ciphertext.len);
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
+
/* Create GCM opertaion */
retval = create_gcm_operation(RTE_CRYPTO_CIPHER_OP_DECRYPT,
tdata->auth_tag.data, tdata->auth_tag.len,
else
plaintext = ciphertext;
-#ifdef RTE_APP_TEST_DEBUG
- rte_hexdump(stdout, "plaintext:", plaintext, tdata->ciphertext.len);
-#endif
+ TEST_HEXDUMP(stdout, "plaintext:", plaintext, tdata->ciphertext.len);
+
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(
plaintext,