public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/9] [v3] rsa: Modify rsa lib to use hw acceleration
@ 2014-12-23 11:32 Ruchika Gupta
  2014-12-23 11:32 ` [U-Boot] [PATCH 1/9] [v3] rsa: Split the rsa-verify to separate the modular exponentiation Ruchika Gupta
                   ` (8 more replies)
  0 siblings, 9 replies; 28+ messages in thread
From: Ruchika Gupta @ 2014-12-23 11:32 UTC (permalink / raw)
  To: u-boot

The rsa-verify functionality is a two step operation involving:
1. Checksum (hash) Calculation over image regions
2. Public Key Modular exponentiation over signature to generate hash
 
The following patch set modifies the rsa library to use hw 
acceleration if available in platform.

The first two patches in the series, split the rsa-verify lib
into two files:
1. rsa-verify.c
Does Verification

2. rsa-mod-exp.c
Does Modular Exponentiation

Driver Model is added for RSA Modular Exponentiation. 

The patch set also has patches are related with hash lib support in RSA.
 
For hash, the infrastructure already exists in common/hash.c. 
rsa_checksum is modified to use the API's registered with the hash_algo
structure. Once HW accelerated support for progressive hash is available,
RSA library can easily pick it up.


Ruchika Gupta (9):
  rsa: Split the rsa-verify to separate the modular exponentiation
  FIT: Modify option FIT_SIGNATURE in Kconfig
  DM: crypto/rsa: Add rsa Modular Exponentiation DM driver
  configs: Move CONFIG_FIT_SIGNATURE to defconfig
  lib/rsa: Modify rsa to use DM driver if available
  DM: crypto/fsl - Add Freescale rsa DM driver
  lib/rsa: Add Kconfig option for HW accelerated RSA
  hash: Add function to find hash_algo struct with progressive hash
  rsa: Use checksum algorithms from struct hash_algo

Changes in v3:
Simon's comments incoprorated.
- Driver Model added for RSA Modular Exponentiation
- Other cosmetic changes like multiline comments etc incoporated
- CONFIG_FIT_SIGNATURE moved to defconfig file for the boards using it

I have tested it's compilation on sandbox platform. However, I don't have
the sandbox board available with me to test it. The patches have been
tested on freescale platform LS1020 with all the configs and tests
available in test/vboot. The tests have been done with both RSA_HW as well as
RSA_SW driver.

Changes in v2:
Kconfig option introduced

Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>

 Kconfig                            |   3 +-
 common/hash.c                      |  33 +++-
 common/image-sig.c                 |   6 +-
 configs/ids8313_defconfig          |   2 +
 configs/sandbox_defconfig          |   3 +
 configs/zynq_microzed_defconfig    |   3 +
 configs/zynq_zc70x_defconfig       |   3 +
 configs/zynq_zc770_xm010_defconfig |   3 +
 configs/zynq_zc770_xm012_defconfig |   3 +
 configs/zynq_zc770_xm013_defconfig |   3 +
 configs/zynq_zed_defconfig         |   3 +
 configs/zynq_zybo_defconfig        |   3 +
 drivers/crypto/Kconfig             |   3 +
 drivers/crypto/Makefile            |   1 +
 drivers/crypto/fsl/Kconfig         |   6 +
 drivers/crypto/fsl/Makefile        |   1 +
 drivers/crypto/fsl/fsl_rsa.c       |  62 +++++++
 drivers/crypto/fsl/jobdesc.c       |  28 +++
 drivers/crypto/fsl/jobdesc.h       |   5 +
 drivers/crypto/fsl/rsa_caam.h      |  27 +++
 drivers/crypto/rsa/Kconfig         |   5 +
 drivers/crypto/rsa/Makefile        |   8 +
 drivers/crypto/rsa/rsa_sw.c        |  39 ++++
 drivers/crypto/rsa/rsa_uclass.c    |  32 ++++
 include/configs/am335x_evm.h       |   5 +-
 include/configs/ids8313.h          |   3 -
 include/configs/sandbox.h          |   3 -
 include/configs/zynq-common.h      |   6 -
 include/dm/uclass-id.h             |   1 +
 include/hash.h                     |  15 ++
 include/image.h                    |   5 +-
 include/u-boot/rsa-checksum.h      |   7 +-
 include/u-boot/rsa-mod-exp.h       |  83 +++++++++
 lib/Kconfig                        |   2 +
 lib/rsa/Kconfig                    |  52 ++++++
 lib/rsa/Makefile                   |   1 +
 lib/rsa/rsa-checksum.c             |  53 +++++-
 lib/rsa/rsa-mod-exp.c              | 307 ++++++++++++++++++++++++++++++++
 lib/rsa/rsa-verify.c               | 354 +++++++++----------------------------
 tools/Makefile                     |   3 +-
 40 files changed, 872 insertions(+), 313 deletions(-)
 create mode 100644 drivers/crypto/fsl/Kconfig
 create mode 100644 drivers/crypto/fsl/fsl_rsa.c
 create mode 100644 drivers/crypto/fsl/rsa_caam.h
 create mode 100644 drivers/crypto/rsa/Kconfig
 create mode 100644 drivers/crypto/rsa/Makefile
 create mode 100644 drivers/crypto/rsa/rsa_sw.c
 create mode 100644 drivers/crypto/rsa/rsa_uclass.c
 create mode 100644 include/u-boot/rsa-mod-exp.h
 create mode 100644 lib/rsa/Kconfig
 create mode 100644 lib/rsa/rsa-mod-exp.c

-- 
1.8.1.4

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

end of thread, other threads:[~2014-12-30  9:04 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23 11:32 [U-Boot] [PATCH 0/9] [v3] rsa: Modify rsa lib to use hw acceleration Ruchika Gupta
2014-12-23 11:32 ` [U-Boot] [PATCH 1/9] [v3] rsa: Split the rsa-verify to separate the modular exponentiation Ruchika Gupta
2014-12-24  0:47   ` Simon Glass
2014-12-23 11:32 ` [U-Boot] [PATCH 2/9] [v3] FIT: Modify option FIT_SIGNATURE in Kconfig Ruchika Gupta
2014-12-24  0:47   ` Simon Glass
2014-12-23 11:32 ` [U-Boot] [PATCH 3/9] [v3] DM: crypto/rsa: Add rsa Modular Exponentiation DM driver Ruchika Gupta
2014-12-24  0:48   ` Simon Glass
2014-12-23 11:32 ` [U-Boot] [PATCH 4/9] [v3] configs: Move CONFIG_FIT_SIGNATURE to defconfig Ruchika Gupta
2014-12-24  0:48   ` Simon Glass
2014-12-23 11:32 ` [U-Boot] [PATCH 5/9] [v3] lib/rsa: Modify rsa to use DM driver if available Ruchika Gupta
2014-12-24  0:49   ` Simon Glass
     [not found]     ` <BY1PR0301MB1288C126892D064BE49D4E6FEF540@BY1PR0301MB1288.namprd03.prod.outlook.com>
2014-12-29 21:10       ` Simon Glass
2014-12-23 11:32 ` [U-Boot] [PATCH 6/9] [v3] DM: crypto/fsl - Add Freescale rsa DM driver Ruchika Gupta
2014-12-24  0:49   ` Simon Glass
2014-12-23 11:32 ` [U-Boot] [PATCH 7/9] [v3] lib/rsa: Add Kconfig option for HW accelerated RSA Ruchika Gupta
2014-12-24  0:49   ` Simon Glass
2014-12-29  7:05     ` Ruchika Gupta
2014-12-29 20:28       ` Simon Glass
2014-12-23 11:32 ` [U-Boot] [PATCH 8/9] [v3] hash: Add function to find hash_algo struct with progressive hash Ruchika Gupta
2014-12-24  0:50   ` Simon Glass
2014-12-29  7:07     ` Ruchika Gupta
2014-12-29 21:13       ` Simon Glass
2014-12-30  9:04         ` Ruchika Gupta
2014-12-23 11:32 ` [U-Boot] [PATCH 9/9] [v3] rsa: Use checksum algorithms from struct hash_algo Ruchika Gupta
2014-12-24  0:50   ` Simon Glass
     [not found]     ` <BY1PR0301MB1288E92E4FEF74B81F040302EF510@BY1PR0301MB1288.namprd03.prod.outlook.com>
2014-12-29  8:00       ` Ruchika Gupta
2014-12-29 21:12       ` Simon Glass
2014-12-30  8:58         ` Ruchika Gupta

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