diff options
author | Rob Austein <sra@hactrn.net> | 2018-05-20 15:50:41 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2018-05-20 15:53:16 -0400 |
commit | 85f1e04bdc3676c33d0534093ea89fc655b63500 (patch) | |
tree | b4a228a7bc99a5d120aedc7b8c5a5f1f0e2ca4e2 | |
parent | 6018d41414ef013f79df36d0b232cec8c5de5e47 (diff) |
Mutex for RSA blinding factors cache.
-rw-r--r-- | projects/hsm/hsm.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); } |