lib: rsa: generate additional parameters for public key
[oweals/u-boot.git] / include / u-boot / rsa-mod-exp.h
index 8a428c4b6a1ac88fcbe5ef5fce62b0e356a3c11c..1da8af1bb83dbbf37cff2f392d3717b7bcea237c 100644 (file)
@@ -26,6 +26,29 @@ struct key_prop {
        uint32_t exp_len;       /* Exponent length in number of uint8_t */
 };
 
+/**
+ * rsa_gen_key_prop() - Generate key properties of RSA public key
+ * @key:       Specifies key data in DER format
+ * @keylen:    Length of @key
+ * @prop:      Generated key property
+ *
+ * This function takes a blob of encoded RSA public key data in DER
+ * format, parse it and generate all the relevant properties
+ * in key_prop structure.
+ * Return a pointer to struct key_prop in @prop on success.
+ *
+ * Return:     0 on success, negative on error
+ */
+int rsa_gen_key_prop(const void *key, uint32_t keylen, struct key_prop **proc);
+
+/**
+ * rsa_free_key_prop() - Free key properties
+ * @prop:      Pointer to struct key_prop
+ *
+ * This function frees all the memories allocated by rsa_gen_key_prop().
+ */
+void rsa_free_key_prop(struct key_prop *prop);
+
 /**
  * rsa_mod_exp_sw() - Perform RSA Modular Exponentiation in sw
  *