From: Varun Wadekar <vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Kim Phillips
<kim.phillips-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
"herbert-F6s6mLieUQo7FNHlEwC/lvQIK84fMopw@public.gmane.org"
<herbert-F6s6mLieUQo7FNHlEwC/lvQIK84fMopw@public.gmane.org>,
"davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org"
<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
"linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v1] crypto: driver for tegra AES hardware
Date: Wed, 16 Nov 2011 12:44:50 +0530 [thread overview]
Message-ID: <4EC362EA.3020204@nvidia.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF1740805D40-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
> That doesn't make the duplicate memset/copy cease to be redundant.
>
> Why not copy the key to where it goes, then memset the rest of the data;
> wouldn't that be as simple as:
>
> memcpy(dd->ivkey_base, ctx->key, ctx->keylen);
> memset(dd->ivkey_base + ctx->keylen, 0, AES_HW_KEY_TABLE_LENGTH_BYTES - ctx->keylen);
Seems like the same thing to me. Kim is inclined towards removing the
memset completely, which I think should not be done. We need the memset
to clear the entire key table.
> Related to this, I wonder why:
>
> /*
> * The key table length is 64 bytes
> * (This includes first upto 32 bytes key + 16 bytes original initial vector
> * and 16 bytes updated initial vector)
> */
> #define AES_HW_KEY_TABLE_LENGTH_BYTES 64
>
> Yet:
>
> dd->ivkey_base = dma_alloc_coherent(dev, SZ_512, &dd->ivkey_phys_base, ...
>
> Why is SZ_512 used to during alloc instead of AES_HW_KEY_TABLE_LENGTH_BYTES?
Correct. Will fix this.
next prev parent reply other threads:[~2011-11-16 7:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-05 10:42 [PATCH v1] crypto: driver for tegra AES hardware vwadekar
[not found] ` <1320489734-9085-1-git-send-email-vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-05 23:10 ` Kim Phillips
[not found] ` <20111105181025.69918e625a169ccb30d9b7c8-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2011-11-12 10:22 ` Varun Wadekar
[not found] ` <4EBE48E8.60205-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-14 17:26 ` Stephen Warren
2011-11-14 19:13 ` Kim Phillips
2011-11-15 4:10 ` Varun Wadekar
[not found] ` <4EC1E642.2090309-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-15 16:10 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF1740805D40-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-16 7:14 ` Varun Wadekar [this message]
[not found] ` <4EC362EA.3020204-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-16 8:57 ` Kim Phillips
[not found] ` <20111116025720.27e6b710e8b333612862bb2e-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2011-11-16 9:05 ` Varun Wadekar
[not found] ` <4EC37CBC.4060806-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-16 9:17 ` Kim Phillips
[not found] ` <20111116031703.e006c81ebf5368365e7a22fb-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2011-11-16 12:28 ` Varun Wadekar
[not found] ` <4EC3AC7D.4080705-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-17 11:29 ` Varun Wadekar
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=4EC362EA.3020204@nvidia.com \
--to=vwadekar-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=herbert-F6s6mLieUQo7FNHlEwC/lvQIK84fMopw@public.gmane.org \
--cc=kim.phillips-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox