[Cryptech-Commits] [sw/libhal] 05/05: Use the second sha256 core, if available, for pbkdf2.

git at cryptech.is git at cryptech.is
Wed Jul 6 23:02:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/libhal.

commit 7923c24511b1f176dfb69f199fba6fccb4954c0b
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Wed Jul 6 18:18:28 2016 -0400

    Use the second sha256 core, if available, for pbkdf2.
    
    This is a hopefully temporary stopgap, in lieu of proper resource
    management and/or sharing of cores between threads.
---
 pbkdf2.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pbkdf2.c b/pbkdf2.c
index f361328..c696f2f 100644
--- a/pbkdf2.c
+++ b/pbkdf2.c
@@ -105,6 +105,15 @@ hal_error_t hal_pbkdf2(const hal_core_t *core,
   if ((uint64_t) derived_key_length > ((uint64_t) 0xFFFFFFFF) * descriptor->block_length)
     return HAL_ERROR_UNSUPPORTED_KEY;
 
+#if 1
+  /* HACK - find the second sha256 core, to avoid interfering with rpc.
+   * If there isn't a second one, this will set core to NULL, and
+   * hal_hash_initialize will find the first one.
+   */
+  core = hal_core_find(descriptor->core_name, NULL);
+  core = hal_core_find(descriptor->core_name, core);
+#endif
+
   memset(result, 0, sizeof(result));
   memset(mac,    0, sizeof(mac));
 



More information about the Commits mailing list