]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - include/rsa.h
rsa: add sha256-rsa2048 algorithm
[karo-tx-uboot.git] / include / rsa.h
index add4c789f335488f3ed5442365acf9a95dc49d84..e9ae870622c97bee4b02109bdf9a8ddca21ad34d 100644 (file)
 #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