diff options
author | Rob Austein <sra@hactrn.net> | 2015-06-10 18:34:18 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2015-06-10 18:34:18 -0400 |
commit | 9cca19087b29d5678dc39fd446bd8f6a6036b097 (patch) | |
tree | a925c7684f9f13a69a8bcd4b9ba9461289a121ea /cryptech.h | |
parent | e1029f9213ba3df2b3b1774c4085df9df67352de (diff) |
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.
Diffstat (limited to 'cryptech.h')
-rw-r--r-- | cryptech.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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_ */ /* |