summaryrefslogtreecommitdiffstats
path: root/include/rsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rsa.h')
-rw-r--r--include/rsa.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/rsa.h b/include/rsa.h
index add4c789f3..e9ae870622 100644
--- a/include/rsa.h
+++ b/include/rsa.h
@@ -15,6 +15,20 @@
#include <errno.h>
#include <image.h>
+/**
+ * struct rsa_public_key - holder for a public key
+ *
+ * An RSA public key consists of a modulus (typically called N), the inverse
+ * and R^2, where R is 2^(# key bits).
+ */
+
+struct rsa_public_key {
+ uint len; /* len of modulus[] in number of uint32_t */
+ uint32_t n0inv; /* -1 / modulus[0] mod 2^32 */
+ uint32_t *modulus; /* modulus as little endian array */
+ uint32_t *rr; /* R^2 as little endian array */
+};
+
#if IMAGE_ENABLE_SIGN
/**
* sign() - calculate and return signature for given input data
OpenPOWER on IntegriCloud