Re: [PATCH v1] crypto: driver for tegra AES hardware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 14 Nov 2011 09:26:16 -0800
Stephen Warren <swarren@xxxxxxxxxx> wrote:

> Varun Wadekar wrote at Saturday, November 12, 2011 3:23 AM:
> > >> +	/* assign new context to device */
> > >> +	ctx->dd = dd;
> > >> +	dd->ctx = ctx;
> > >> +
> > >> +	if (ctx->flags & FLAGS_NEW_KEY) {
> > >> +		/* copy the key */
> > >> +		memset(dd->ivkey_base, 0, AES_HW_KEY_TABLE_LENGTH_BYTES);
> > >> +		memcpy(dd->ivkey_base, ctx->key, ctx->keylen);
> > > these really should be writes to mutually exclusive addresses.
> > 
> > Why?
> 
> To avoid redundant work; there's little point memset()ing a region that's
> going to be copied over the top of immediately afterwards.

plus, why is the memset needed at all?

Kim

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux