[Cryptech-Commits] [sw/libhal] branch hashsig updated: Add some yields to try to improve responsiveness during hashsig key generation and deletion.
git at cryptech.is
git at cryptech.is
Tue May 1 21:44:15 UTC 2018
This is an automated email from the git hooks/post-receive script.
paul at psgd.org pushed a commit to branch hashsig
in repository sw/libhal.
The following commit(s) were added to refs/heads/hashsig by this push:
new 2b9f5c4 Add some yields to try to improve responsiveness during hashsig key generation and deletion.
2b9f5c4 is described below
commit 2b9f5c433514135a0409d99dd347dd6070fcf1e6
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Tue May 1 17:35:18 2018 -0400
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 */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Commits
mailing list