public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ruchika Gupta <ruchika.gupta@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Fw: [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 and SHA1
Date: Wed, 15 Oct 2014 09:08:53 +0000	[thread overview]
Message-ID: <1413364131950.35930@freescale.com> (raw)
In-Reply-To: <9501b665c3394b91824fffc7373ef50b@BL2PR03MB466.namprd03.prod.outlook.com>

Th message bounced back due to some encoding issue. Forwarding the reply again.

________________________________________
From: Gupta Ruchika-R66431
Sent: Wednesday, October 15, 2014 2:32 PM
To: Simon Glass
Cc: U-Boot Mailing List; Sun York-R58495
Subject: RE: [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 and SHA1

Hi Simon,

I have defined the functions for hardware acceleration  which are already present in hash.c for Freescale platforms.

In hash.c
static struct hash_algo hash_algo[] = {
        /*
         * CONFIG_SHA_HW_ACCEL is defined if hardware acceleration is
         * available.
         */
#ifdef CONFIG_SHA_HW_ACCEL
        {
                "sha1",
                SHA1_SUM_LEN,
                hw_sha1,
                CHUNKSZ_SHA1,
        }, {
                "sha256",
                SHA256_SUM_LEN,
                hw_sha256,
                CHUNKSZ_SHA256,
        },
#endif
        /*

In the patch below, I have added defined the above functions for Freescale platforms.

+void hw_sha256(const unsigned char *pbuf, unsigned int buf_len,
+                       unsigned char *pout, unsigned int chunk_size)
+{
+       if (caam_hash(pbuf, buf_len, pout, SHA256))
+               printf("CAAM was not setup properly or it is faulty\n");
+}
+
+void hw_sha1(const unsigned char *pbuf, unsigned int buf_len,
+                       unsigned char *pout, unsigned int chunk_size)
+{
+       if (caam_hash(pbuf, buf_len, pout, SHA1))
+               printf("CAAM was not setup properly or it is faulty\n");
+}

Regards,
Ruchika

> -----Original Message-----
> From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
> Sent: Wednesday, October 15, 2014 12:56 PM
> To: Gupta Ruchika-R66431
> Cc: U-Boot Mailing List; Sun York-R58495
> Subject: Re: [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated
> SHA256 and SHA1
>
> Hi,>
> On 15 October 2014 08:05, Ruchika Gupta <ruchika.gupta@freescale.com> wrote:
> > SHA-256 and SHA-1 accelerated using SEC hardware in Freescale SoC's
> > The driver for SEC (CAAM) IP is based on linux drivers/crypto/caam.
> > The platforms needto add the MACRO CONFIG_FSL_CAAM inorder to enable
> > initialization of this hardware IP.
> >
> > Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
> > CC: York Sun <yorksun@freescale.com>
> > ---
> > Changes from v2:
> > CAAM init was earlier enabled by default for all platforms with SEC > 4.
> > Restricting it to platforms which want to enable CAAM
> >
> > Changes from v1:
> > Added a common function run_descriptor_jr to avoid repetition of
> > common code
>
> Are you able to plumb this into hash.c? See hash_algo[].
>
> Regards,
> Simon

  parent reply	other threads:[~2014-10-15  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15  6:05 [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 and SHA1 Ruchika Gupta
2014-10-15  6:05 ` [U-Boot] [PATCH 2/2][v3] mpc85xx: configs - Add hash command in freescale platforms Ruchika Gupta
2014-10-15  7:26 ` [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 and SHA1 Simon Glass
     [not found]   ` <9501b665c3394b91824fffc7373ef50b@BL2PR03MB466.namprd03.prod.outlook.com>
2014-10-15  9:08     ` Ruchika Gupta [this message]
2014-10-15 15:58     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1413364131950.35930@freescale.com \
    --to=ruchika.gupta@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox