Skip to content

Commit 95a4829

Browse files
authored
Merge pull request #129 from padelsbach/wp_add_ecx_tests
Add test_ecx with basic tests for ED25519 and ED448
2 parents b5970aa + f4575d4 commit 95a4829

File tree

5 files changed

+436
-0
lines changed

5 files changed

+436
-0
lines changed

src/wp_ecx_kmgmt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,10 @@ static int wp_ed25519_export_public(ed25519_key* key, const byte* out,
15081508

15091509
if (!key->pubKeySet) {
15101510
ret = wc_ed25519_make_public(key, (byte*)out, *outLen);
1511+
if (ret == 0) {
1512+
/* Store the generated public key in the key object for future use. */
1513+
ret = wc_ed25519_import_public((byte*)out, *outLen, key);
1514+
}
15111515
}
15121516
else {
15131517
ret = wc_ed25519_export_public(key, (byte*)out, outLen);
@@ -1638,6 +1642,10 @@ static int wp_ed448_export_public(ed448_key* key, const byte* out,
16381642

16391643
if (!key->pubKeySet) {
16401644
ret = wc_ed448_make_public(key, (byte*)out, *outLen);
1645+
if (ret == 0) {
1646+
/* Store the generated public key in the key object for future use. */
1647+
ret = wc_ed448_import_public((byte*)out, *outLen, key);
1648+
}
16411649
}
16421650
else {
16431651
ret = wc_ed448_export_public(key, (byte*)out, outLen);

test/include.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ test_unit_test_SOURCES = \
1818
test/test_dh.c \
1919
test/test_digest.c \
2020
test/test_ecc.c \
21+
test/test_ecx.c \
2122
test/test_gmac.c \
2223
test/test_hkdf.c \
2324
test/test_hmac.c \

0 commit comments

Comments
 (0)