From 85f1e04bdc3676c33d0534093ea89fc655b63500 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 20 May 2018 15:50:41 -0400 Subject: Mutex for RSA blinding factors cache. --- projects/hsm/hsm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c index f20ee64..64529f6 100644 --- a/projects/hsm/hsm.c +++ b/projects/hsm/hsm.c @@ -409,6 +409,12 @@ task_mutex_t ks_mutex = { 0 }; void hal_ks_lock(void) { task_mutex_lock(&ks_mutex); } void hal_ks_unlock(void) { task_mutex_unlock(&ks_mutex); } +/* A mutex to arbitrary concurrent access to the RSA blinding factors cache. + */ +task_mutex_t rsa_bf_mutex = { 0 }; +void hal_rsa_bf_lock(void) { task_mutex_lock(&rsa_bf_mutex); } +void hal_rsa_bf_unlock(void) { task_mutex_unlock(&rsa_bf_mutex); } + /* Sleep for specified number of seconds. */ void hal_sleep(const unsigned seconds) { task_delay(seconds * 1000); } -- cgit v1.2.3