LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC PATCH 1/2] crypto: Allow working with key references
@ 2019-05-29 22:48 Richard Weinberger
  2019-05-29 22:48 ` [RFC PATCH 2/2] crypto: mxs-dcp: Implement reference keys Richard Weinberger
  2019-05-30  2:33 ` [RFC PATCH 1/2] crypto: Allow working with key references Herbert Xu
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Weinberger @ 2019-05-29 22:48 UTC (permalink / raw)
  To: linux-crypto
  Cc: linux-arm-kernel, linux-kernel, linux-imx, festevam, kernel,
	s.hauer, shawnguo, davem, herbert, david, Richard Weinberger

Some crypto accelerators allow working with secure or hidden keys.
This keys are not exposed to Linux nor main memory. To use them
for a crypto operation they are referenced with a device specific id.

This patch adds a new flag, CRYPTO_TFM_REQ_REF_KEY.
If this flag is set, crypto drivers should tread the key as
specified via setkey as reference and not as regular key.
Since we reuse the key data structure such a reference is limited
by the key size of the chiper and is chip specific.

TODO: If the cipher implementation or the driver does not
support reference keys, we need a way to detect this an fail
upon setkey.
How should the driver indicate that it supports this feature?

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 include/linux/crypto.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index f2565a103158..737ea00e026b 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -121,6 +121,7 @@
 #define CRYPTO_TFM_REQ_FORBID_WEAK_KEYS	0x00000100
 #define CRYPTO_TFM_REQ_MAY_SLEEP	0x00000200
 #define CRYPTO_TFM_REQ_MAY_BACKLOG	0x00000400
+#define CRYPTO_TFM_REQ_REF_KEY		0x00000800
 #define CRYPTO_TFM_RES_WEAK_KEY		0x00100000
 #define CRYPTO_TFM_RES_BAD_KEY_LEN   	0x00200000
 #define CRYPTO_TFM_RES_BAD_KEY_SCHED 	0x00400000
-- 
2.16.4


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

end of thread, other threads:[~2019-06-03 14:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 22:48 [RFC PATCH 1/2] crypto: Allow working with key references Richard Weinberger
2019-05-29 22:48 ` [RFC PATCH 2/2] crypto: mxs-dcp: Implement reference keys Richard Weinberger
2019-05-30  2:33 ` [RFC PATCH 1/2] crypto: Allow working with key references Herbert Xu
2019-05-30  7:23   ` Richard Weinberger
2019-06-03  7:59     ` Harald Freudenberger
2019-06-03 14:15       ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).