Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 48: Add SecCipher_ProcessOpaqueWithMapAndPattern #49

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/sec_security.h
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,10 @@ Sec_Result SecCipher_ProcessOpaqueWithMap(Sec_CipherHandle* cipherHandle, SEC_BY
SEC_SIZE inputSize, SEC_BOOL lastInput, SEC_MAP* map, SEC_SIZE mapLength,
Sec_OpaqueBufferHandle** opaqueBufferHandle, SEC_SIZE* bytesWritten);

Sec_Result SecCipher_ProcessOpaqueWithMapAndPattern(Sec_CipherHandle* cipherHandle, SEC_BYTE* iv, SEC_BYTE* input,
SEC_SIZE inputSize, SEC_BOOL lastInput, SEC_MAP* map, SEC_SIZE mapLength, SEC_SIZE numEncryptedBlocks,
SEC_SIZE numClearBlocks, Sec_OpaqueBufferHandle** opaqueBufferHandle, SEC_SIZE* bytesWritten);

#ifdef __cplusplus
}
#endif
Expand Down
100 changes: 100 additions & 0 deletions src/sec_adapter_cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,12 @@ Sec_Result SecCipher_ProcessOpaqueWithMap(Sec_CipherHandle* cipherHandle, SEC_BY
return SEC_RESULT_FAILURE;
}

if (cipherHandle->algorithm != SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING &&
cipherHandle->algorithm != SEC_CIPHERALGORITHM_AES_CTR) {
SEC_LOG_ERROR("Not CBC or CTR mode");
return SEC_RESULT_INVALID_PARAMETERS;
}

Sec_Result result = SecOpaqueBuffer_Malloc(inputSize, opaqueBufferHandle);
if (result != SEC_RESULT_SUCCESS) {
SEC_LOG_ERROR("SecOpaqueBuffer_Malloc failed");
Expand Down Expand Up @@ -995,6 +1001,100 @@ Sec_Result SecCipher_ProcessOpaqueWithMap(Sec_CipherHandle* cipherHandle, SEC_BY
return SEC_RESULT_SUCCESS;
}

Sec_Result SecCipher_ProcessOpaqueWithMapAndPattern(Sec_CipherHandle* cipherHandle, SEC_BYTE* iv, SEC_BYTE* input,
SEC_SIZE inputSize, SEC_BOOL lastInput, SEC_MAP* map, SEC_SIZE mapLength, SEC_SIZE numEncryptedBlocks,
SEC_SIZE numClearBlocks, Sec_OpaqueBufferHandle** opaqueBufferHandle, SEC_SIZE* bytesWritten) {

if (cipherHandle == NULL) {
SEC_LOG_ERROR("NULL cipherHandle");
return SEC_RESULT_FAILURE;
}

if (iv == NULL) {
SEC_LOG_ERROR("NULL iv");
return SEC_RESULT_FAILURE;
}

if (input == NULL) {
SEC_LOG_ERROR("NULL input");
return SEC_RESULT_FAILURE;
}

if (map == NULL) {
SEC_LOG_ERROR("NULL map");
return SEC_RESULT_FAILURE;
}

if (opaqueBufferHandle == NULL) {
SEC_LOG_ERROR("NULL opaqueBufferHandle");
return SEC_RESULT_FAILURE;
}

if (bytesWritten == NULL) {
SEC_LOG_ERROR("NULL bytesWritten");
return SEC_RESULT_FAILURE;
}

if (cipherHandle->algorithm != SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING &&
cipherHandle->algorithm != SEC_CIPHERALGORITHM_AES_CTR) {
SEC_LOG_ERROR("Not CBC or CTR mode");
return SEC_RESULT_INVALID_PARAMETERS;
}

Sec_Result result = SecOpaqueBuffer_Malloc(inputSize, opaqueBufferHandle);
if (result != SEC_RESULT_SUCCESS) {
SEC_LOG_ERROR("SecOpaqueBuffer_Malloc failed");
return SEC_RESULT_FAILURE;
}

sa_subsample_length* subsample_lengths = malloc(mapLength * sizeof(sa_subsample_length));
for (size_t i = 0; i < mapLength; i++) {
subsample_lengths[i].bytes_of_clear_data = map[i].clear;
subsample_lengths[i].bytes_of_protected_data = map[i].encrypted;
}

sa_buffer out_buffer;
out_buffer.buffer_type = SA_BUFFER_TYPE_SVP;
out_buffer.context.svp.offset = 0;
out_buffer.context.svp.buffer = get_svp_buffer(cipherHandle->processorHandle, *opaqueBufferHandle);
if (out_buffer.context.svp.buffer == INVALID_HANDLE) {
free(subsample_lengths);
SecOpaqueBuffer_Free(*opaqueBufferHandle);
*opaqueBufferHandle = NULL;
*bytesWritten = 0;
return SEC_RESULT_FAILURE;
}

sa_buffer in_buffer;
in_buffer.buffer_type = SA_BUFFER_TYPE_CLEAR;
in_buffer.context.clear.buffer = input;
in_buffer.context.clear.length = inputSize;
in_buffer.context.clear.offset = 0;

sa_sample sample;
sample.iv = iv;
sample.iv_length = SEC_AES_BLOCK_SIZE;
sample.crypt_byte_block = numEncryptedBlocks;
sample.skip_byte_block = numClearBlocks;
sample.subsample_count = mapLength;
sample.subsample_lengths = subsample_lengths;
sample.context = cipherHandle->cipher.context;
sample.out = &out_buffer;
sample.in = &in_buffer;

sa_status status = sa_invoke(cipherHandle->processorHandle, SA_PROCESS_COMMON_ENCRYPTION, (size_t) 1, &sample);
free(subsample_lengths);
if (status != SA_STATUS_OK) {
SecOpaqueBuffer_Free(*opaqueBufferHandle);
*opaqueBufferHandle = NULL;
*bytesWritten = 0;
CHECK_STATUS(status)
}

*bytesWritten = out_buffer.context.svp.offset;
return SEC_RESULT_SUCCESS;
}

Sec_Result get_cipher_algorithm(const Sec_CipherAlgorithm algorithm, SEC_BOOL is_unwrap,
sa_cipher_algorithm* cipher_algorithm, void** parameters, void* iv, SEC_SIZE key_length, SEC_SIZE key_offset) {
*parameters = NULL;
Expand Down
84 changes: 84 additions & 0 deletions test/main/cpp/cipher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,90 @@ Sec_Result testProcessOpaqueWithMap(SEC_OBJECTID id, TestKey key, TestKc kc, Sec
return result;
}

Sec_Result testProcessOpaqueWithMapAndPattern(SEC_OBJECTID id, TestKey key, TestKc kc, Sec_StorageLoc loc,
Sec_CipherAlgorithm alg, SEC_SIZE subsampleCount, SEC_SIZE bytesOfClearData, SEC_SIZE numEncryptedBlocks,
SEC_SIZE numClearBlocks) {
TestCtx ctx;

if (ctx.init() != SEC_RESULT_SUCCESS) {
SEC_LOG_ERROR("ctx.init failed");
return SEC_RESULT_FAILURE;
}

Sec_KeyHandle* keyHandle = nullptr;
if ((keyHandle = ctx.provisionKey(id, loc, key, kc)) == nullptr) {
SEC_LOG_ERROR("ctx.provisionKey failed");
return SEC_RESULT_FAILURE;
}

//gen iv
std::vector<SEC_BYTE> iv = TestCtx::random(SEC_AES_BLOCK_SIZE);
TestCtx::printHex("iv", iv);

//gen clear input
std::vector<SEC_BYTE> clear = TestCtx::random(SUBSAMPLE_SIZE * subsampleCount);
TestCtx::printHex("clear", clear);

//encrypt
std::vector<SEC_BYTE> encrypted;
std::vector<SEC_BYTE> ivCopy = iv;

//use openssl to encrypt
std::vector<SEC_BYTE> temp;
for (size_t i = 0; i < subsampleCount; i++) {
temp.insert(temp.end(),
clear.begin() + static_cast<int64_t>(i * SUBSAMPLE_SIZE + bytesOfClearData),
clear.begin() + static_cast<int64_t>((i + 1) * SUBSAMPLE_SIZE));
}

std::vector<SEC_BYTE> encryptedTemp = cipherOpenSSL(key, alg, SEC_CIPHERMODE_ENCRYPT, &ivCopy[0], temp);
SEC_SIZE bytesOfProtectedData = SUBSAMPLE_SIZE - bytesOfClearData;
for (size_t i = 0; i < subsampleCount; i++) {
encrypted.insert(encrypted.end(),
clear.begin() + static_cast<int64_t>(i * SUBSAMPLE_SIZE),
clear.begin() + static_cast<int64_t>(i * SUBSAMPLE_SIZE + bytesOfClearData));
encrypted.insert(encrypted.end(),
encryptedTemp.begin() + static_cast<int64_t>(i * bytesOfProtectedData),
encryptedTemp.begin() + static_cast<int64_t>((i + 1) * bytesOfProtectedData));
}

TestCtx::printHex("encrypted", encrypted);
TestCtx::printHex("iv", iv);

Sec_CipherHandle* cipherHandle = ctx.acquireCipher(alg, SEC_CIPHERMODE_DECRYPT, keyHandle, &iv[0]);
if (cipherHandle == nullptr) {
SEC_LOG_ERROR("TestCtx::acquireCipher failed");
return SEC_RESULT_FAILURE;
}

auto* map = new SEC_MAP[subsampleCount];
if (map == nullptr) {
SEC_LOG_ERROR("malloc failed");
return SEC_RESULT_FAILURE;
}

for (SEC_SIZE i = 0; i < subsampleCount; i++) {
map[i].clear = bytesOfClearData;
map[i].encrypted = SUBSAMPLE_SIZE - bytesOfClearData;
}

//decrypt
std::vector<SEC_BYTE> decrypted;
Sec_OpaqueBufferHandle* opaqueBufferHandle;
SEC_SIZE bytesWritten = 0;
Sec_Result result = SecCipher_ProcessOpaqueWithMapAndPattern(cipherHandle, iv.data(), encrypted.data(), encrypted.size(),
SEC_TRUE, map, subsampleCount, numEncryptedBlocks, numClearBlocks, &opaqueBufferHandle, &bytesWritten);
if (result != SEC_RESULT_SUCCESS) {
delete[] map;
SEC_LOG_ERROR("SecCipher_ProcessOpaqueWithMapAndPattern failed");
return result;
}

delete[] map;
SecOpaqueBuffer_Free(opaqueBufferHandle);
return result;
}

Sec_Result testProcessOpaqueWithMapVariable(SEC_OBJECTID id, TestKey key, TestKc kc, Sec_StorageLoc loc,
Sec_CipherAlgorithm alg) {
TestCtx ctx;
Expand Down
4 changes: 4 additions & 0 deletions test/main/cpp/cipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ Sec_Result testCtrRollover(SEC_OBJECTID id, TestKey key, TestKc kc, Sec_StorageL
Sec_Result testProcessOpaqueWithMap(SEC_OBJECTID id, TestKey key, TestKc kc, Sec_StorageLoc loc,
Sec_CipherAlgorithm alg, SEC_SIZE subsampleCount, SEC_SIZE bytesOfClearData);

Sec_Result testProcessOpaqueWithMapAndPattern(SEC_OBJECTID id, TestKey key, TestKc kc, Sec_StorageLoc loc,
Sec_CipherAlgorithm alg, SEC_SIZE subsampleCount, SEC_SIZE bytesOfClearData, SEC_SIZE numEncryptedBlocks,
SEC_SIZE numClearBlocks);

Sec_Result testProcessOpaqueWithMapVariable(SEC_OBJECTID id, TestKey key, TestKc kc, Sec_StorageLoc loc,
Sec_CipherAlgorithm alg);

Expand Down
114 changes: 114 additions & 0 deletions test/main/cpp/sec_api_utest_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,120 @@ void runSVPTests(SuiteCtx* suite) {
SEC_CIPHERALGORITHM_AES_CTR)); \
RUN_TEST(suite, testProcessOpaqueWithMapVariable(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING)); \
\
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 20, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 20, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 20, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 20, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 1, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 1, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 1, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 2, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 2, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 2, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 5, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 5, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 5, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 10, 0, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 10, 16, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 10, 256, 1, 9)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 20, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 1, 256, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 20, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 2, 256, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 20, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 5, 256, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 20, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CTR, 10, 256, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 1, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 1, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 1, 256, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 2, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 2, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 2, 256, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 5, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 5, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 5, 256, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 10, 0, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 10, 16, 5, 5)); \
RUN_TEST(suite, testProcessOpaqueWithMapAndPattern(SEC_OBJECTID_USER_BASE, key, kc, loc, \
SEC_CIPHERALGORITHM_AES_CBC_NO_PADDING, 10, 256, 5, 5)); \
\
} while (0)

void runWrappedTests(SuiteCtx* suite) { // NOLINT
Expand Down