From 2b9f5c433514135a0409d99dd347dd6070fcf1e6 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Tue, 1 May 2018 17:35:18 -0400 Subject: Add some yields to try to improve responsiveness during hashsig key generation and deletion. --- hashsig.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hashsig.c b/hashsig.c index 0396ff7..2ffe995 100644 --- a/hashsig.c +++ b/hashsig.c @@ -716,6 +716,7 @@ static hal_error_t lms_generate(lms_key_t *key) s = u16str(D_LEAF); check(hal_hash_update(state, (const uint8_t *)&s, sizeof(s))); check(hal_hash_update(state, (const uint8_t *)&lmots_key.K, sizeof(lmots_key.K))); check(hal_hash_finalize(state, (uint8_t *)&key->T[r], sizeof(key->T[r]))); + hal_task_yield_maybe(); } /* generate the rest of T[r] = H(I || u32str(r) || u16str(D_INTR) || T[2*r] || T[2*r+1]) */ @@ -727,6 +728,7 @@ static hal_error_t lms_generate(lms_key_t *key) check(hal_hash_update(state, (const uint8_t *)&key->T[2*r], sizeof(key->T[r]))); check(hal_hash_update(state, (const uint8_t *)&key->T[2*r+1], sizeof(key->T[r]))); check(hal_hash_finalize(state, (uint8_t *)&key->T[r], sizeof(key->T[r]))); + hal_task_yield_maybe(); } memcpy(&key->T1, &key->T[1], sizeof(key->T1)); @@ -754,6 +756,7 @@ static hal_error_t lms_delete(const lms_key_t * const key) for (size_t i = 0; i < (1U << key->lms->h); ++i) { memcpy(&slot.name, &key->lmots_keys[i], sizeof(slot.name)); check(hal_ks_delete(ks, &slot)); + hal_task_yield_maybe(); } /* delete the lms key */ -- cgit v1.2.3