Linux cryptographic layer development
 help / color / mirror / Atom feed
* crypto_ahash_setkey
@ 2011-11-22 22:00 Kasatkin, Dmitry
  2011-11-23  6:08 ` crypto_ahash_setkey Steffen Klassert
  2011-11-23  7:44 ` crypto_ahash_setkey Herbert Xu
  0 siblings, 2 replies; 7+ messages in thread
From: Kasatkin, Dmitry @ 2011-11-22 22:00 UTC (permalink / raw)
  To: linux-crypto

Hi,

I have noticed very odd behavior with hmac calculation on my dual
core, 4 HTs PC.
I am using async hash API to to calculate hmac over the page.
I am using "hmac(sha1)" and the same key to calculate different pages.

I have a work queue, which calculates the hmac like...

int()
{
    tfm = crypto_alloc_ahash(...);
}

work_task()
{
     crypto_ahash_setkey(tfm, key, keylen);
     crypto_ahash_digest(req);
}

HMAC result "sometimes" is incorrect.

But when I move crypto_ahash_setkey() do the initialization code then
HMAC result is always correct...
(key is the same, so I can initialize it only once)

int()
{
     tfm = crypto_alloc_ahash(...);
     crypto_ahash_setkey(tfm, key, keylen);
}

work_task()
{
     crypto_ahash_digest(req);
}

It seems that crypto_ahash_setkey() somehow sometimes does wrong things...

I hope my explanation is clear.

Any ideas why it might happen?

Thanks,

- Dmitry

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

end of thread, other threads:[~2011-11-23 10:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 22:00 crypto_ahash_setkey Kasatkin, Dmitry
2011-11-23  6:08 ` crypto_ahash_setkey Steffen Klassert
2011-11-23  9:09   ` crypto_ahash_setkey Kasatkin, Dmitry
2011-11-23  7:44 ` crypto_ahash_setkey Herbert Xu
2011-11-23  9:08   ` crypto_ahash_setkey Kasatkin, Dmitry
2011-11-23 10:07     ` crypto_ahash_setkey Herbert Xu
2011-11-23 10:25       ` crypto_ahash_setkey Kasatkin, Dmitry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox