But I wonder why it's included here. Maybe for secure storage of private keys? I'm guessing that's the desired purpose for TPM in a server setting.
Obviously I'm not super familiar with TPM. I wonder if it can be used for things like better random number generation or hardware-accelerated hashing. I'm guessing if it supported hashing from userspace, the cryptocurrency crowd would have been all over it already.
Too slow to be useful, and the BCM283x SoC already has an internal RNG:
https://github.com/torvalds/linux/blob/master/drivers/char/h...
> ... or hardware-accelerated hashing
The TPM is on a really slow bus (33 MHz, 4 bits, tons of wait states). Even without any hardware acceleration, hashing on the CPU is much faster.
This is particularly useful at boot when entropy is very low.
Hardware accelerated hashing would be severely limited by the SPI bus speed.
[0] https://www.zymbit.com/2020/11/10/blog-security-module-raspb...
But yeah, I think the idea is TPM is a bit more standardized across hardware, so some software that uses it would not need any tweaks to run on the Pi with a TPM built-in.
But there are USB HSMs, along with smart cards (which are also HSMs). Aren't those pretty standard?
The TPM specification has its own crypto interface that is standard across all hardware, so you can do things like generate a key and perform crypto operations without requiring the hardware implement a particular interface beyond whatever TPM version you require.
There are advantages and disadvantages to both approaches. On Linux, TPMs are implemented in the kernel, and CCID is handled by userspace drivers.
Also something interesting to noodle on: technically the Pi 4/CM4/Pi 400 have ECC RAM [1] — but some ECC functionality may require CPU-level integration... which I'm guessing isn't present on the Pi's SoC (but who knows? I posted this forum topic asking for clarification: [2]).
[1] Product brief mentions LPDDR4 with on-die ECC: https://datasheets.raspberrypi.org/rpi4/raspberry-pi-4-produ...
[2] https://www.raspberrypi.org/forums/viewtopic.php?t=315415