aboutsummaryrefslogtreecommitdiff
path: root/include/u-boot
diff options
context:
space:
mode:
authorPhilippe Reynes2018-11-14 13:51:00 +0100
committerTom Rini2018-12-03 10:44:10 -0500
commit20031567e12bb312bff95b70767f6275e20f0346 (patch)
tree00c9c34581da071f3a87ee01c27370cc524cf223 /include/u-boot
parent3b5d6979fcb80ffae3b140be6edc04cbde1a0b72 (diff)
rsa: add a structure for the padding
The rsa signature use a padding algorithm. By default, we use the padding pkcs-1.5. In order to add some new padding algorithm, we add a padding framework to manage several padding algorithm. The choice of the padding is done in the file .its. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/u-boot')
-rw-r--r--include/u-boot/rsa.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/u-boot/rsa.h b/include/u-boot/rsa.h
index 68bcb14c74d..16b4c4caeea 100644
--- a/include/u-boot/rsa.h
+++ b/include/u-boot/rsa.h
@@ -97,6 +97,10 @@ static inline int rsa_add_verify_data(struct image_sign_info *info,
int rsa_verify(struct image_sign_info *info,
const struct image_region region[], int region_count,
uint8_t *sig, uint sig_len);
+
+int padding_pkcs_15_verify(struct image_sign_info *info,
+ uint8_t *msg, int msg_len,
+ const uint8_t *hash, int hash_len);
#else
static inline int rsa_verify(struct image_sign_info *info,
const struct image_region region[], int region_count,
@@ -104,8 +108,17 @@ static inline int rsa_verify(struct image_sign_info *info,
{
return -ENXIO;
}
+
+static inline int padding_pkcs_15_verify(struct image_sign_info *info,
+ uint8_t *msg, int msg_len,
+ const uint8_t *hash, int hash_len)
+{
+ return -ENXIO;
+}
#endif
+#define RSA_DEFAULT_PADDING_NAME "pkcs-1.5"
+
#define RSA2048_BYTES (2048 / 8)
#define RSA4096_BYTES (4096 / 8)