On Wed, Oct 12, 2022 at 05:06:16PM +0800, Herbert Xu wrote: > > Rather, drivers that do AES should be called "aes". For this hardware > > key situation, I guess that means keys have a type (in-memory vs > > hardware-resident). Then, a crypto operation takes an "algorithm" and a > > "key", and the abstraction then picks the best implementation that's > > compatible with both the "algorithm" and the "key". > > No the key is already in a specific hardware bound to some driver. > The user already knows where the key is and therefore they know > which driver it is. Do they? We have HW that can do HW resident keys as as well, in our case it is plugged into the storage system with fscrypt and all the crypto operations are being done "inline" as the data is DMA'd into/out of the storage. So, no crypto API here. I would say the user knows about the key and its binding in the sense they loaded a key into the storage device and mounted a fscrypt filesystem from that storage device - but the kernel may not know this explicitly. > > If you don't want a proliferation of different ways of doing the same > > thing, maybe the requirement should be that the author of this series > > also converts the existing "paes" kludge to use the new thing he's > > proposing? > > Yes that would definitely be a good idea. We should also talk to the > people who added paes in the first place, i.e., s390. Yes, it would be nice to see a comprehensive understand on how HW resident keys can be modeled in the keyring. Almost every computer now has a TPM that is also quite capable of doing operations with these kinds of keys. Seeing the whole picture, including how we generate and load/save/provision these things seems important. Jason