Re: [PATCH 2/2] crypto: sahara - add support for SHA1/256

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

 



On Fri, Aug 29, 2014 at 03:58:55PM +0200, Steffen Trumtrar wrote:
> 
> On Fri, Aug 29, 2014 at 09:44:42PM +0800, Herbert Xu wrote:
> > On Mon, Aug 18, 2014 at 03:13:39PM +0200, Steffen Trumtrar wrote:
> > >
> > > +struct sahara_sha_reqctx {
> > > +	unsigned int mode;
> > > +	unsigned int digest_size;
> > > +	unsigned int context_size;
> > > +	u8 buf[SAHARA_MAX_SHA_BLOCK_SIZE];
> > > +	unsigned int buf_cnt;
> > > +	unsigned int hash_rem;
> > > +	struct sg_table data_sg;
> > > +	struct scatterlist buf_sg;
> > > +	unsigned int sg_in_idx;
> > > +	unsigned int result_idx;
> > > +};
> > 
> > So where is the hash state stored?
> > 
> 
> The hash state is stored in the context_base variable in sahara_dev.
> Freescale calls it context in their driver (the only source of information
> I have to develop a GPL driver).
> To simplify the driver I allocated the context also as dma_alloc_coherent,
> same as the key_base for AES.

Hmm that's a bit of a problem because our API requires the hash
state to be stored in the request as otherwise a new request
belonging to a different hash computation will cause corruption.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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