All of lore.kernel.org
 help / color / mirror / Atom feed
* [QUESTION] hash import and request initialization
@ 2017-12-25  8:07 Gilad Ben-Yossef
  2017-12-26  3:07 ` Herbert Xu
  0 siblings, 1 reply; 9+ messages in thread
From: Gilad Ben-Yossef @ 2017-12-25  8:07 UTC (permalink / raw)
  To: Linux Crypto Mailing List, Herbert Xu

Hi there,

I have ran into something I am unsure about regarding the ccree driver
implementation and would love to get some guidance:

I have assumed, based on previous list correspondence, that both of
the following sequences are legal:

Scenario A
1. ahash_request_alloc
2. ahash_import

Scenario B
1. ahash_request_alloc
2. crypto_ahash_init
3. ahash_import

However, I've run into the problem that since ahash_request_alloc does
not zero the allocated request memory
and specifically does not zero the tfm specific context part of it, I
have no way to distinguish  between A and B and therefore
if I have any initialization sequence that needs to happen once per
request (DMA buffer allocation and mapping in my
case), I cannot tell if I need to do them in ahash_import callback or not.

The testmgr test uses scenario A, but this is nor here nor there.

So, am I'm missing something here or is the B scenario simply not legal?

Many thanks and Happy Xmas if this applies to you,
Gilad



-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-01-10 15:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-25  8:07 [QUESTION] hash import and request initialization Gilad Ben-Yossef
2017-12-26  3:07 ` Herbert Xu
2017-12-26  9:06   ` Gilad Ben-Yossef
2017-12-26 10:40     ` Herbert Xu
2017-12-26 12:21       ` Gilad Ben-Yossef
2017-12-27  3:35         ` Herbert Xu
2017-12-27  6:27           ` Gilad Ben-Yossef
2018-01-10 14:32           ` [PATCH] dm-integrity: don't store cipher request on the stack (was: [QUESTION] hash import and request initialization) Mikulas Patocka
2018-01-10 15:13             ` Mike Snitzer

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.