Skip to content

Commit 5cb4cdd

Browse files
committed
Regen wh_test_cert_data.h, fixes in ed25519
1 parent d6d5080 commit 5cb4cdd

4 files changed

Lines changed: 1059 additions & 1021 deletions

File tree

test-refactor/client-server/wh_test_crypto.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,20 @@ int whTest_CryptoEcc256(whClientContext* ctx)
168168
int ret = 0;
169169
WC_RNG rng[1];
170170
ecc_key key[1];
171-
uint8_t hash[32] = {0};
171+
/* Non-zero digest: wolfCrypt rejects all-zero hashes with ECC_BAD_ARG_E
172+
* unless WC_ALLOW_ECC_ZERO_HASH is defined. */
173+
uint8_t hash[32];
172174
uint8_t sig[ECC_MAX_SIG_SIZE] = {0};
173175
word32 sigLen = sizeof(sig);
174176
int verify = 0;
177+
word32 i;
175178

176179
(void)ctx;
177180

181+
for (i = 0; i < sizeof(hash); i++) {
182+
hash[i] = (uint8_t)(i + 1);
183+
}
184+
178185
/* Minimal P-256 sign/verify round-trip routed through the server via
179186
* WH_DEV_ID. Key size 32 selects SECP256R1 as wolfCrypt's default. */
180187
ret = wc_InitRng_ex(rng, NULL, devId);

0 commit comments

Comments
 (0)