Skip to content

Commit 5c4c692

Browse files
committed
tests: add Ed25519 tests
1 parent 948f324 commit 5c4c692

File tree

3 files changed

+411
-1
lines changed

3 files changed

+411
-1
lines changed

src/wh_client_crypto.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,9 @@ int wh_Client_Ed25519Sign(whClientContext* ctx, ed25519_key* key,
22872287
ret = wh_Client_SendRequest(ctx, group, action, req_len,
22882288
(uint8_t*)dataPtr);
22892289
if (ret == WH_ERROR_OK) {
2290+
/* Server will evict at this point. Reset evict */
2291+
evict = 0;
2292+
22902293
uint16_t res_len = 0;
22912294
do {
22922295
ret = wh_Client_RecvResponse(ctx, &group, &action, &res_len,
@@ -2326,6 +2329,10 @@ int wh_Client_Ed25519Sign(whClientContext* ctx, ed25519_key* key,
23262329
}
23272330
}
23282331

2332+
if (evict != 0) {
2333+
(void)wh_Client_KeyEvict(ctx, key_id);
2334+
}
2335+
23292336
return ret;
23302337
}
23312338

@@ -2394,6 +2401,9 @@ int wh_Client_Ed25519Verify(whClientContext* ctx, ed25519_key* key,
23942401
ret = wh_Client_SendRequest(ctx, group, action, req_len,
23952402
(uint8_t*)dataPtr);
23962403
if (ret == WH_ERROR_OK) {
2404+
/* Server will evict at this point. Reset evict */
2405+
evict = 0;
2406+
23972407
uint16_t res_len = 0;
23982408
do {
23992409
ret = wh_Client_RecvResponse(ctx, &group, &action, &res_len,
@@ -2421,6 +2431,10 @@ int wh_Client_Ed25519Verify(whClientContext* ctx, ed25519_key* key,
24212431
}
24222432
}
24232433

2434+
if (evict != 0) {
2435+
(void)wh_Client_KeyEvict(ctx, key_id);
2436+
}
2437+
24242438
return ret;
24252439
}
24262440

test/config/user_settings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@
137137
#define WOLFSSL_SHAKE128
138138
#define WOLFSSL_SHAKE256
139139

140+
/* Ed25519 Options */
141+
#define HAVE_ED25519
142+
140143
/* The following options can be individually controlled to customize the
141144
* ML-DSA configuration */
142145
#if 0

0 commit comments

Comments
 (0)