All of lore.kernel.org
 help / color / mirror / Atom feed
* Adding algorithm agility to the crypto library functions
@ 2025-10-14 16:01 James Bottomley
  2025-10-14 16:55 ` Eric Biggers
  0 siblings, 1 reply; 8+ messages in thread
From: James Bottomley @ 2025-10-14 16:01 UTC (permalink / raw)
  To: linux-crypto; +Cc: Eric Biggers, Ard Biesheuvel

The TPM session calculation functions recently got converted to use the
rawkey functions instead of open coding it 64a7cfbcf548 ("tpm: Use
HMAC-SHA256 library instead of open-coded HMAC").  This works today
because the user has no input on the hmac hash algorithm so, although
the TPM specifies it to be agile, we can simply choose sha256. 
However, we have plans to use what are called policy sessions, which
have require the same hash as the user supplied object used for its
name (essentially a hash chosen by the user).  In a TPM these hashes
can be any of the family sha1 sha256, sha384 sha512 plus a few esoteric
ones like sm3.  So the question becomes: to avoid going back to open
coding the hmac and using the shash API, is there a way of adding hash
agility to the library algorithms?  I suppose I could also do this
inside our hmac code using a large set of switch statements, but that
would be a bit gross.

If no-one's planning to do this I can take a stab ... it would probably
still be a bunch of switch statements, but not in my code ...

Regards,

James


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

end of thread, other threads:[~2025-10-15  5:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 16:01 Adding algorithm agility to the crypto library functions James Bottomley
2025-10-14 16:55 ` Eric Biggers
2025-10-14 17:08   ` Ard Biesheuvel
2025-10-14 17:30     ` Eric Biggers
2025-10-14 17:32     ` James Bottomley
2025-10-14 17:39       ` Eric Biggers
2025-10-14 20:17         ` James Bottomley
2025-10-15  4:59       ` Simon Richter

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.