Re: [PATCH v6 3/5] crypto: tegra: Add Tegra Security Engine driver

2024-04-02 Thread Herbert Xu
On Tue, Apr 02, 2024 at 12:36:41PM +, Akhil R wrote: > > Should I set the reqsize as below in sha_cra_init()? Seeing this in other > crypto drivers. > > crypto_ahash_set_reqsize(ahash_tfm, > sizeof(struct tegra_sha_reqctx) + > crypto_aha

RE: [PATCH v6 3/5] crypto: tegra: Add Tegra Security Engine driver

2024-04-02 Thread Akhil R
> On Tue, Mar 19, 2024 at 01:53:04PM +0530, Akhil R wrote: > > > > +struct tegra_sha_reqctx { > > + struct ahash_request fallback_req; > > This doesn't work because ahash_request is dynamically sized. > So you'll end up clobbering the rest of the struct if a fallback ends up > being used. >

RE: [PATCH v6 3/5] crypto: tegra: Add Tegra Security Engine driver

2024-04-02 Thread Akhil R
> > > > + .alg.skcipher.op.do_one_request = tegra_aes_do_one_req, > > + .alg.skcipher.base = { > > + .init = tegra_aes_cra_init, > > + .exit = tegra_aes_cra_exit, > > + .setkey = tegra_aes_setkey, > > +

Re: [PATCH v6 3/5] crypto: tegra: Add Tegra Security Engine driver

2024-03-28 Thread Herbert Xu
On Tue, Mar 19, 2024 at 01:53:04PM +0530, Akhil R wrote: > > +struct tegra_sha_reqctx { > + struct ahash_request fallback_req; This doesn't work because ahash_request is dynamically sized. So you'll end up clobbering the rest of the struct if a fallback ends up being used. You should place th

Re: [PATCH v6 3/5] crypto: tegra: Add Tegra Security Engine driver

2024-03-28 Thread Herbert Xu
On Tue, Mar 19, 2024 at 01:53:04PM +0530, Akhil R wrote: > > + .alg.skcipher.op.do_one_request = tegra_aes_do_one_req, > + .alg.skcipher.base = { > + .init = tegra_aes_cra_init, > + .exit = tegra_aes_cra_exit, > + .

[PATCH v6 3/5] crypto: tegra: Add Tegra Security Engine driver

2024-03-19 Thread Akhil R
Add support for Tegra Security Engine which can accelerate various crypto algorithms. The Engine has two separate instances within for AES and HASH algorithms respectively. The driver registers two crypto engines - one for AES and another for HASH algorithms and these operate independently and bot