From ddac3affaf95e4a2b01074e9aaea13ba3e469eb5 Mon Sep 17 00:00:00 2001 From: Muhammad Ali Date: Wed, 27 Sep 2023 07:07:44 -0400 Subject: [PATCH] Improve RSAPSS usage example (#425) Case analysis of invlaid key arguments. --- tests/rsapss.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/rsapss.cc b/tests/rsapss.cc index 029065a2..440e63e3 100644 --- a/tests/rsapss.cc +++ b/tests/rsapss.cc @@ -35,8 +35,17 @@ TEST(ApiSuite, ApiTest) generate_rsapss_key(&e, &eBits, &d, &dBits, &mod, &modBits); uint64_t* skey = Hacl_RSAPSS_new_rsapss_load_skey(modBits, eBits, dBits, mod, e, d); + + if (skey == NULL) { + //Error + } + uint64_t* pkey = Hacl_RSAPSS_new_rsapss_load_pkey(modBits, eBits, mod, e); + if (pkey == NULL) { + //Error + } + // Message const char* msg = "Hello, World!"; size_t msgLen = strlen(msg);