From 9cca19087b29d5678dc39fd446bd8f6a6036b097 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 10 Jun 2015 18:34:18 -0400 Subject: Add hal_modexp(), since the protocol is a bit complex. Rewrite test-rsa to use hal_modexp(), and generate a new set of test keys without the whacky padding, since hal_modexp() now handles that. --- cryptech.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cryptech.h') diff --git a/cryptech.h b/cryptech.h index 03d3476..1ca6a89 100644 --- a/cryptech.h +++ b/cryptech.h @@ -583,6 +583,20 @@ extern hal_error_t hal_pbkdf2(const hal_hash_descriptor_t * const descriptor, uint8_t * derived_key, const size_t derived_key_length, unsigned iterations_desired); +/* + * Modular exponentiation. + */ + +extern void hal_modexp_set_debug(const int onoff); + +extern hal_error_t hal_modexp(const uint8_t * const msg, const size_t msg_len, /* Message */ + const uint8_t * const exp, const size_t exp_len, /* Exponent */ + const uint8_t * const mod, const size_t mod_len, /* Modulus */ + uint8_t * result, const size_t result_len); + + + + #endif /* _CRYPTECH_H_ */ /* -- cgit v1.2.3