From f23b4c6fd3ebee70ff7f8df5f088cfe27ff48a29 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 19 Jun 2015 20:03:03 -0400 Subject: Add methods to extract public components from an RSA key. Other minor cleanup and commenting within RSA module. --- cryptech.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cryptech.h') diff --git a/cryptech.h b/cryptech.h index d8f1208..b0a7c35 100644 --- a/cryptech.h +++ b/cryptech.h @@ -628,6 +628,16 @@ extern hal_error_t hal_rsa_key_load(const hal_rsa_key_type_t type, const uint8_t * const dP, const size_t dP_len, const uint8_t * const dQ, const size_t dQ_len); +extern hal_error_t hal_rsa_key_get_modulus(hal_rsa_key_t key, + uint8_t *modulus, + size_t *modulus_len, + const size_t modulus_max); + +extern hal_error_t hal_rsa_key_get_public_exponent(hal_rsa_key_t key, + uint8_t *public_exponent, + size_t *public_exponent_len, + const size_t public_exponent_max); + extern void hal_rsa_key_clear(hal_rsa_key_t key); extern hal_error_t hal_rsa_encrypt(hal_rsa_key_t key, -- cgit v1.2.3