mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
rsa: add sha256,rsa4096 algorithm
Add support for sha256,rsa4096 signatures in u-boot. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Cc: andreas@oetken.name
This commit is contained in:
@@ -879,6 +879,7 @@ struct image_region {
|
||||
struct checksum_algo {
|
||||
const char *name;
|
||||
const int checksum_len;
|
||||
const int pad_len;
|
||||
#if IMAGE_ENABLE_SIGN
|
||||
const EVP_MD *(*calculate)(void);
|
||||
#else
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <sha1.h>
|
||||
#include <sha256.h>
|
||||
|
||||
extern const uint8_t padding_sha256_rsa4096[];
|
||||
extern const uint8_t padding_sha256_rsa2048[];
|
||||
extern const uint8_t padding_sha1_rsa2048[];
|
||||
|
||||
|
||||
@@ -103,4 +103,14 @@ static inline int rsa_verify(struct image_sign_info *info,
|
||||
}
|
||||
#endif
|
||||
|
||||
#define RSA2048_BYTES (2048 / 8)
|
||||
#define RSA4096_BYTES (4096 / 8)
|
||||
|
||||
/* This is the minimum/maximum key size we support, in bits */
|
||||
#define RSA_MIN_KEY_BITS 2048
|
||||
#define RSA_MAX_KEY_BITS 4096
|
||||
|
||||
/* This is the maximum signature length that we support, in bits */
|
||||
#define RSA_MAX_SIG_BITS 4096
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user