aboutsummaryrefslogtreecommitdiff
path: root/cryptech.h
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-06-10 18:34:18 -0400
committerRob Austein <sra@hactrn.net>2015-06-10 18:34:18 -0400
commit9cca19087b29d5678dc39fd446bd8f6a6036b097 (patch)
treea925c7684f9f13a69a8bcd4b9ba9461289a121ea /cryptech.h
parente1029f9213ba3df2b3b1774c4085df9df67352de (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.h14
1 files changed, 14 insertions, 0 deletions
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_ */
/*