All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kim Phillips <kim.phillips@freescale.com>
To: Lee Nipper <lee.nipper@gmail.com>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH 3/3] crypto: talitos - Add ahash algorithms (1st cut, digest only)
Date: Tue, 24 Mar 2009 19:11:14 -0500	[thread overview]
Message-ID: <20090324191114.203adeae.kim.phillips@freescale.com> (raw)
In-Reply-To: <1237166510-7312-4-git-send-email-lee.nipper@gmail.com>

On Sun, 15 Mar 2009 20:21:50 -0500
Lee Nipper <lee.nipper@gmail.com> wrote:

> +	/* first DWORD empty */
> +	desc->ptr[0].len = 0;
> +	desc->ptr[0].ptr = 0;
> +	desc->ptr[0].j_extent = 0;
> +
> +	/* second DWORD empty */
> +	desc->ptr[1].len = 0;
> +	desc->ptr[1].ptr = 0;
> +	desc->ptr[1].j_extent = 0;
> +
> +	/* cipher key */
> +	if (ctx->keylen)
> +		map_single_talitos_ptr(dev, &desc->ptr[2], ctx->keylen,
> +				       (char *)&ctx->key, 0, DMA_TO_DEVICE);
> +	else {
> +		desc->ptr[2].len = 0;
> +		desc->ptr[2].ptr = 0;
> +		desc->ptr[2].j_extent = 0;
> +	}

just

map_single_talitos_ptr(dev, &desc->ptr[2], ctx->keylen,
		       (char *)&ctx->key, 0, DMA_TO_DEVICE);

should do since theoretically the device should ignore pointer entries
with len == 0 and j_extent == 0 (unless you have observed otherwise
practically).

> +	if (sg_count == 1) {
> +		desc->ptr[3].ptr = cpu_to_be32(sg_dma_address(areq->src));
> +	} else {
> +		sg_count = sg_to_link_tbl(areq->src, sg_count, length,
> +					  &edesc->link_tbl[0]);
> +		if (sg_count > 1) {
> +			desc->ptr[3].j_extent |= DESC_PTR_LNKTBL_JUMP;
> +			desc->ptr[3].ptr = cpu_to_be32(edesc->dma_link_tbl);
> +			dma_sync_single_for_device(ctx->dev, edesc->dma_link_tbl,
> +						   edesc->dma_len, DMA_BIDIRECTIONAL);
> +		} else {
> +			/* Only one segment now, so no link tbl needed */
> +			desc->ptr[3].ptr = cpu_to_be32(sg_dma_address(areq->src));
> +		}
> +	}

same readability comment as in prior patch.

> diff --git a/drivers/crypto/talitos.h b/drivers/crypto/talitos.h
> index 575981f..85deb0a 100644
> --- a/drivers/crypto/talitos.h
> +++ b/drivers/crypto/talitos.h
> @@ -162,6 +162,8 @@
>  #define	DESC_HDR_MODE0_MDEU_MD5		cpu_to_be32(0x00200000)
>  #define	DESC_HDR_MODE0_MDEU_SHA256	cpu_to_be32(0x00100000)
>  #define	DESC_HDR_MODE0_MDEU_SHA1	cpu_to_be32(0x00000000)
> +#define	DESC_HDR_MODE0_MDEU_SHA384	cpu_to_be32(0x00000000) /*MDEUB*/
> +#define	DESC_HDR_MODE0_MDEU_SHA512	cpu_to_be32(0x00200000) /*MDEUB*/
>  #define	DESC_HDR_MODE0_MDEU_MD5_HMAC	(DESC_HDR_MODE0_MDEU_MD5 | \
>  					 DESC_HDR_MODE0_MDEU_HMAC)
>  #define	DESC_HDR_MODE0_MDEU_SHA256_HMAC	(DESC_HDR_MODE0_MDEU_SHA256 | \
> @@ -183,6 +185,9 @@
>  #define	DESC_HDR_MODE1_MDEU_MD5		cpu_to_be32(0x00000200)
>  #define	DESC_HDR_MODE1_MDEU_SHA256	cpu_to_be32(0x00000100)
>  #define	DESC_HDR_MODE1_MDEU_SHA1	cpu_to_be32(0x00000000)
> +#define	DESC_HDR_MODE1_MDEU_SHA384	cpu_to_be32(0x00000000) /*MDEUB*/
> +#define	DESC_HDR_MODE1_MDEU_SHA512	cpu_to_be32(0x00000200) /*MDEUB*/

DESC_HDR_MODE0_MDEUB_SHA384 instead of having the comment?

Kim

  reply	other threads:[~2009-03-24 23:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16  1:21 [PATCH] crypto: talitos - protect against possible null ptr upon error Lee Nipper
2009-03-16  1:21 ` [PATCH 1/3] crypto: talitos - scaffolding for new algorithm types Lee Nipper
2009-03-16  1:21   ` [PATCH 2/3] crypto: talitos - Add ablkcipher algorithms Lee Nipper
2009-03-16  1:21     ` [PATCH 3/3] crypto: talitos - Add ahash algorithms (1st cut, digest only) Lee Nipper
2009-03-25  0:11       ` Kim Phillips [this message]
2009-03-24 23:57     ` [PATCH 2/3] crypto: talitos - Add ablkcipher algorithms Kim Phillips
2009-03-24 23:34   ` [PATCH 1/3] crypto: talitos - scaffolding for new algorithm types Kim Phillips
2009-03-24 21:23 ` [PATCH] crypto: talitos - protect against possible null ptr upon error Kim Phillips
2009-03-25  4:06   ` Lee Nipper

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=20090324191114.203adeae.kim.phillips@freescale.com \
    --to=kim.phillips@freescale.com \
    --cc=lee.nipper@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.