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

crypto_test: Add test cases for PSS sign and verify #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 12 additions & 2 deletions internal_api/crypto_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,12 +1363,11 @@ static uint32_t run_ecdsa_tests()
return 0;
}

static uint32_t RSA_sig_and_ver()
static uint32_t RSA_sig_and_ver_algos(uint32_t rsa_alg)
{
TEE_Result ret;
TEE_ObjectHandle rsa_keypair = (TEE_ObjectHandle)NULL;
size_t key_size = 512;
uint32_t rsa_alg = TEE_ALG_RSASSA_PKCS1_V1_5_SHA1;
char *dig_msg = "TEST";
uint32_t fn_ret = 1; /* Initialized error return */

Expand Down Expand Up @@ -1419,6 +1418,17 @@ static uint32_t RSA_sig_and_ver()
return fn_ret;
}

static uint32_t RSA_sig_and_ver()
{
// run the tests for all the algorithms
if (RSA_sig_and_ver_algos(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1) ||
RSA_sig_and_ver_algos(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1))
return 1;

PRI_OK("-");
return 0;
}

static uint32_t HMAC_computation_basic()
{
TEE_Result ret;
Expand Down