aboutsummaryrefslogtreecommitdiff
path: root/cryptech.h
diff options
context:
space:
mode:
Diffstat (limited to 'cryptech.h')
-rw-r--r--cryptech.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/cryptech.h b/cryptech.h
index 1ca6a89..6f7d439 100644
--- a/cryptech.h
+++ b/cryptech.h
@@ -442,6 +442,10 @@
DEFINE_HAL_ERROR(HAL_ERROR_KEYWRAP_BAD_MAGIC, "Bad magic number while unwrapping key") \
DEFINE_HAL_ERROR(HAL_ERROR_KEYWRAP_BAD_LENGTH, "Length out of range while unwrapping key") \
DEFINE_HAL_ERROR(HAL_ERROR_KEYWRAP_BAD_PADDING, "Non-zero padding detected unwrapping key") \
+ DEFINE_HAL_ERROR(HAL_ERROR_CRT_FAILED, "CRT calculation failed") \
+ DEFINE_HAL_ERROR(HAL_ERROR_ALLOCATION_FAILURE, "Memory allocation failed") \
+ DEFINE_HAL_ERROR(HAL_ERROR_UNKNOWN_TFM_FAILURE, "Unknown libtfm failure") \
+ DEFINE_HAL_ERROR(HAL_ERROR_RESULT_TOO_LONG, "Result too long for buffer") \
END_OF_HAL_ERROR_LIST
/* Marker to forestall silly line continuation errors */
@@ -595,6 +599,22 @@ extern hal_error_t hal_modexp(const uint8_t * const msg, const size_t msg_len, /
uint8_t * result, const size_t result_len);
+/*
+ * RSA. This is not the real API (yet), just test functions for debugging.
+ */
+
+extern void hal_rsa_set_debug(const int onoff);
+
+extern hal_error_t hal_rsa_crt(const uint8_t * const m, const size_t m_len,
+ const uint8_t * const n, const size_t n_len,
+ const uint8_t * const e, const size_t e_len,
+ const uint8_t * const d, const size_t d_len,
+ const uint8_t * const p, const size_t p_len,
+ const uint8_t * const q, const size_t q_len,
+ const uint8_t * const u, const size_t u_len,
+ uint8_t * result, const size_t result_len);
+
+
#endif /* _CRYPTECH_H_ */