Skip to content

Commit

Permalink
Exclude XMSS from some tests temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
ashman-p committed Sep 25, 2023
1 parent 9819909 commit d873aa0
Showing 1 changed file with 40 additions and 3 deletions.
43 changes: 40 additions & 3 deletions tests/test_sig_stfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ static OQS_STATUS sig_stfl_test_correctness(const char *method_name, const char
size_t sk_buf_len = 0;
size_t read_pk_len = 0;

#if OQS_USE_PTHREADS_IN_TESTS
pthread_mutex_t *sk_lock = NULL;
#endif

OQS_STATUS rc, ret = OQS_ERROR;

//The magic numbers are random values.
Expand All @@ -365,7 +369,6 @@ static OQS_STATUS sig_stfl_test_correctness(const char *method_name, const char
OQS_SIG_STFL_SECRET_KEY_SET_unlock(secret_key, unlock_sk_key);

#if OQS_USE_PTHREADS_IN_TESTS
pthread_mutex_t *sk_lock = NULL;
sk_lock = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
if (sk_lock == NULL) {
goto err;
Expand Down Expand Up @@ -742,11 +745,30 @@ static OQS_STATUS sig_stfl_test_secret_key(const char *method_name) {
static OQS_STATUS sig_stfl_test_query_key(const char *method_name) {
OQS_STATUS rc = OQS_SUCCESS;

uint8_t message_1[] = "The quick brown fox ...";
uint8_t message_2[] = "The quick brown fox jumped from the tree.";
size_t message_len_1 = sizeof(message_1);
size_t message_len_2 = sizeof(message_2);

/*
* Temporarily skip algs with long key generation times.
*/

if (strcmp(method_name, OQS_SIG_STFL_alg_lms_sha256_n32_h5_w1) != 0) {
goto skip_test;
} else {
goto keep_going;
}

skip_test:
printf("Skip slow alg %s.\n", method_name);
return rc;

keep_going:

// uint8_t message_1[] = "The quick brown fox ...";
// uint8_t message_2[] = "The quick brown fox jumped from the tree.";
// size_t message_len_1 = sizeof(message_1);
// size_t message_len_2 = sizeof(message_2);

printf("================================================================================\n");
printf("Testing stateful Signature Verification %s\n", method_name);
printf("================================================================================\n");
Expand Down Expand Up @@ -795,6 +817,21 @@ static OQS_STATUS sig_stfl_test_sig_gen(const char *method_name) {
size_t message_len_1 = sizeof(message_1);
size_t message_len_2 = sizeof(message_2);

/*
* Temporarily skip algs with long key generation times.
*/

if (strcmp(method_name, OQS_SIG_STFL_alg_lms_sha256_n32_h5_w1) != 0) {
goto skip_test;
} else {
goto keep_going;
}

skip_test:
printf("Skip slow alg %s.\n", method_name);
return rc;

keep_going:

printf("================================================================================\n");
printf("Testing stateful Signature Generation %s\n", method_name);
Expand Down

0 comments on commit d873aa0

Please sign in to comment.