public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v1 0/1] support rsa3072
@ 2021-12-08 10:36 Jamin Lin
  2021-12-08 10:36 ` [PATCH v1 1/1] " Jamin Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Jamin Lin @ 2021-12-08 10:36 UTC (permalink / raw)
  To: Joel Stanley, Simon Glass, Patrick Doyle, Reuben Dowle, open list
  Cc: troy_lee, steven_lee

support rsa3072

Jamin Lin (1):
  support rsa3072

 common/image-sig.c   | 7 +++++++
 include/u-boot/rsa.h | 1 +
 2 files changed, 8 insertions(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/1] support rsa3072
  2021-12-08 10:36 [PATCH v1 0/1] support rsa3072 Jamin Lin
@ 2021-12-08 10:36 ` Jamin Lin
  2021-12-08 14:48   ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Jamin Lin @ 2021-12-08 10:36 UTC (permalink / raw)
  To: Joel Stanley, Simon Glass, Patrick Doyle, Reuben Dowle, open list
  Cc: troy_lee, steven_lee

This patch set support rsa3072.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 common/image-sig.c   | 7 +++++++
 include/u-boot/rsa.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/common/image-sig.c b/common/image-sig.c
index e4bbac55c1..c94854ef8b 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -85,6 +85,13 @@ struct crypto_algo crypto_algos[] = {
 		.add_verify_data = rsa_add_verify_data,
 		.verify = rsa_verify,
 	},
+	{
+		.name = "rsa3072",
+		.key_len = RSA3072_BYTES,
+		.sign = rsa_sign,
+		.add_verify_data = rsa_add_verify_data,
+		.verify = rsa_verify,
+	},
 	{
 		.name = "rsa4096",
 		.key_len = RSA4096_BYTES,
diff --git a/include/u-boot/rsa.h b/include/u-boot/rsa.h
index 2d3024d8b7..d561e5f8ca 100644
--- a/include/u-boot/rsa.h
+++ b/include/u-boot/rsa.h
@@ -135,6 +135,7 @@ static inline int padding_pss_verify(struct image_sign_info *info,
 #define RSA_DEFAULT_PADDING_NAME		"pkcs-1.5"
 
 #define RSA2048_BYTES	(2048 / 8)
+#define RSA3072_BYTES	(3072 / 8)
 #define RSA4096_BYTES	(4096 / 8)
 
 /* This is the minimum/maximum key size we support, in bits */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 0/1] support rsa3072
@ 2021-12-08 10:37 Jamin Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Jamin Lin @ 2021-12-08 10:37 UTC (permalink / raw)
  To: Alexandru Gagniuc, Simon Glass, Philippe Reynes, Sean Anderson,
	Thomas Perrot, open list
  Cc: troy_lee, steven_lee

This patch set supports rsa3072.

Jamin Lin (1):
  support rsa3072

 include/u-boot/rsa.h   | 1 +
 lib/rsa/rsa-verify.c   | 6 ++++++
 tools/image-sig-host.c | 7 +++++++
 3 files changed, 14 insertions(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] support rsa3072
  2021-12-08 10:36 ` [PATCH v1 1/1] " Jamin Lin
@ 2021-12-08 14:48   ` Tom Rini
  2021-12-09  5:02     ` Jamin Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2021-12-08 14:48 UTC (permalink / raw)
  To: Jamin Lin
  Cc: Joel Stanley, Simon Glass, Patrick Doyle, Reuben Dowle, open list,
	troy_lee, steven_lee

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

On Wed, Dec 08, 2021 at 06:36:21PM +0800, Jamin Lin wrote:

> This patch set support rsa3072.
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
>  common/image-sig.c   | 7 +++++++
>  include/u-boot/rsa.h | 1 +
>  2 files changed, 8 insertions(+)
> 
> diff --git a/common/image-sig.c b/common/image-sig.c
> index e4bbac55c1..c94854ef8b 100644
> --- a/common/image-sig.c
> +++ b/common/image-sig.c
> @@ -85,6 +85,13 @@ struct crypto_algo crypto_algos[] = {
>  		.add_verify_data = rsa_add_verify_data,
>  		.verify = rsa_verify,
>  	},
> +	{
> +		.name = "rsa3072",
> +		.key_len = RSA3072_BYTES,
> +		.sign = rsa_sign,
> +		.add_verify_data = rsa_add_verify_data,
> +		.verify = rsa_verify,
> +	},
>  	{
>  		.name = "rsa4096",
>  		.key_len = RSA4096_BYTES,
> diff --git a/include/u-boot/rsa.h b/include/u-boot/rsa.h
> index 2d3024d8b7..d561e5f8ca 100644
> --- a/include/u-boot/rsa.h
> +++ b/include/u-boot/rsa.h
> @@ -135,6 +135,7 @@ static inline int padding_pss_verify(struct image_sign_info *info,
>  #define RSA_DEFAULT_PADDING_NAME		"pkcs-1.5"
>  
>  #define RSA2048_BYTES	(2048 / 8)
> +#define RSA3072_BYTES	(3072 / 8)
>  #define RSA4096_BYTES	(4096 / 8)
>  
>  /* This is the minimum/maximum key size we support, in bits */

For both of these patches, please expand the commit message and header
so it's clear where you're adding the support to.  Perhaps they should
be squashed in to a single patch as the tooling needs to support it when
the binary also supports it?

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] support rsa3072
  2021-12-08 14:48   ` Tom Rini
@ 2021-12-09  5:02     ` Jamin Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Jamin Lin @ 2021-12-09  5:02 UTC (permalink / raw)
  To: Tom Rini
  Cc: Joel Stanley, Simon Glass, Patrick Doyle, Reuben Dowle, open list,
	Troy Lee, Steven Lee

The 12/08/2021 14:48, Tom Rini wrote:
> On Wed, Dec 08, 2021 at 06:36:21PM +0800, Jamin Lin wrote:
> 
> > This patch set support rsa3072.
> > 
> > Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> > ---
> >  common/image-sig.c   | 7 +++++++
> >  include/u-boot/rsa.h | 1 +
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/common/image-sig.c b/common/image-sig.c
> > index e4bbac55c1..c94854ef8b 100644
> > --- a/common/image-sig.c
> > +++ b/common/image-sig.c
> > @@ -85,6 +85,13 @@ struct crypto_algo crypto_algos[] = {
> >  		.add_verify_data = rsa_add_verify_data,
> >  		.verify = rsa_verify,
> >  	},
> > +	{
> > +		.name = "rsa3072",
> > +		.key_len = RSA3072_BYTES,
> > +		.sign = rsa_sign,
> > +		.add_verify_data = rsa_add_verify_data,
> > +		.verify = rsa_verify,
> > +	},
> >  	{
> >  		.name = "rsa4096",
> >  		.key_len = RSA4096_BYTES,
> > diff --git a/include/u-boot/rsa.h b/include/u-boot/rsa.h
> > index 2d3024d8b7..d561e5f8ca 100644
> > --- a/include/u-boot/rsa.h
> > +++ b/include/u-boot/rsa.h
> > @@ -135,6 +135,7 @@ static inline int padding_pss_verify(struct image_sign_info *info,
> >  #define RSA_DEFAULT_PADDING_NAME		"pkcs-1.5"
> >  
> >  #define RSA2048_BYTES	(2048 / 8)
> > +#define RSA3072_BYTES	(3072 / 8)
> >  #define RSA4096_BYTES	(4096 / 8)
> >  
> >  /* This is the minimum/maximum key size we support, in bits */
> 
> For both of these patches, please expand the commit message and header
> so it's clear where you're adding the support to.  Perhaps they should
> be squashed in to a single patch as the tooling needs to support it when
> the binary also supports it?
> 
> -- 
> Tom
Hi Tom
Thanks for your review.
I sent v2 patch and waiting for your review.
Thanks


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-09  5:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08 10:36 [PATCH v1 0/1] support rsa3072 Jamin Lin
2021-12-08 10:36 ` [PATCH v1 1/1] " Jamin Lin
2021-12-08 14:48   ` Tom Rini
2021-12-09  5:02     ` Jamin Lin
  -- strict thread matches above, loose matches on Subject: below --
2021-12-08 10:37 [PATCH v1 0/1] " Jamin Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox