diff options
author | Paul Selkirk <paul@psgd.org> | 2016-07-05 22:45:35 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2016-07-05 22:45:35 -0400 |
commit | 30f8e4e85b6a337291b09d55d8edc15e422b6341 (patch) | |
tree | 19199dd47bb98e18a96281d34e35d1971565fc72 /tests/test-rsa.c | |
parent | e1c57eff41a57b8a3f16e5d652b5598d75887a21 (diff) |
Attempt to add resource management, for multiple cores of the same type.
Find a suitable core, and mark it busy. Don't forget to release it as soon
as you're done. This has a knock-on effect of un-const'ing core arguments
and struct fields in a lot of places, and it moves some core checks around.
Diffstat (limited to 'tests/test-rsa.c')
-rw-r--r-- | tests/test-rsa.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test-rsa.c b/tests/test-rsa.c index 60fe2a5..57037c0 100644 --- a/tests/test-rsa.c +++ b/tests/test-rsa.c @@ -49,7 +49,7 @@ * Run one modexp test. */ -static int test_modexp(const hal_core_t *core, +static int test_modexp(hal_core_t *core, const char * const kind, const rsa_tc_t * const tc, const rsa_tc_bn_t * const msg, /* Input message */ @@ -74,7 +74,7 @@ static int test_modexp(const hal_core_t *core, * Run one RSA CRT test. */ -static int test_decrypt(const hal_core_t *core, +static int test_decrypt(hal_core_t *core, const char * const kind, const rsa_tc_t * const tc) { @@ -115,7 +115,7 @@ static int test_decrypt(const hal_core_t *core, * Run one RSA key generation + CRT test. */ -static int test_gen(const hal_core_t *core, +static int test_gen(hal_core_t *core, const char * const kind, const rsa_tc_t * const tc) { @@ -277,7 +277,7 @@ static void _time_check(const struct timeval t0, const int ok) * and try generating a signature with that. */ -static int test_rsa(const hal_core_t *core, const rsa_tc_t * const tc) +static int test_rsa(hal_core_t *core, const rsa_tc_t * const tc) { int ok = 1; @@ -298,7 +298,7 @@ static int test_rsa(const hal_core_t *core, const rsa_tc_t * const tc) int main(int argc, char *argv[]) { - const hal_core_t *core = hal_core_find(MODEXPS6_NAME, NULL); + hal_core_t *core = hal_core_find(MODEXPS6_NAME, NULL); if (core == NULL) core = hal_core_find(MODEXPA7_NAME, NULL); const hal_core_info_t *core_info = hal_core_info(core); |