aboutsummaryrefslogtreecommitdiff
path: root/pbkdf2.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2017-05-25 16:09:46 -0400
committerPaul Selkirk <paul@psgd.org>2017-05-25 16:09:46 -0400
commitc6543a796c8b560b06cb1d53fad9ffa3906df111 (patch)
treec90f8a3057a6ed514721abdbd1afbec3e5558d2b /pbkdf2.c
parent052a0781ec41780b534aca749540ed5b939a721a (diff)
Add task_yield_maybe
Diffstat (limited to 'pbkdf2.c')
-rw-r--r--pbkdf2.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/pbkdf2.c b/pbkdf2.c
index 690831f..aa30bb5 100644
--- a/pbkdf2.c
+++ b/pbkdf2.c
@@ -108,13 +108,6 @@ hal_error_t hal_pbkdf2(hal_core_t *core,
memset(result, 0, sizeof(result));
memset(mac, 0, sizeof(mac));
-#if 1
- /* HACK - find the second sha256 core, to avoid interfering with rpc.
- */
- core = hal_core_find(descriptor->core_name, NULL);
- core = hal_core_find(descriptor->core_name, core);
-#endif
-
/*
* We probably should check here to see whether the password is
* longer than the HMAC block size, and, if so, we should hash the
@@ -148,6 +141,8 @@ hal_error_t hal_pbkdf2(hal_core_t *core,
for (iteration = 2; iteration <= iterations_desired; iteration++) {
+ hal_task_yield_maybe();
+
if ((err = do_hmac(core, descriptor, password, password_length,
mac, descriptor->digest_length,
0, mac, sizeof(mac))) != HAL_OK)