From a794d8d876d21d165721b5460264ca811245f5bd Mon Sep 17 00:00:00 2001 From: Gilad Ben-Yossef Date: Mon, 23 Apr 2018 08:25:14 +0100 Subject: crypto: ccree - enable support for hardware keys Enable CryptoCell support for hardware keys. Hardware keys are regular AES keys loaded into CryptoCell internal memory via firmware, often from secure boot ROM or hardware fuses at boot time. As such, they can be used for enc/dec purposes like any other key but cannot (read: extremely hard to) be extracted since since they are not available anywhere in RAM during runtime. The mechanism has some similarities to s390 secure keys although the keys are not wrapped or sealed, but simply loaded offline. The interface was therefore modeled based on the s390 secure keys support. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu --- crypto/testmgr.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'crypto') diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 397b117309f1..c31da0f3f680 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -2581,6 +2581,13 @@ static const struct alg_test_desc alg_test_descs[] = { .dec = __VECS(des3_ede_cbc_dec_tv_template) } } + }, { + /* Same as cbc(aes) except the key is stored in + * hardware secure memory which we reference by index + */ + .alg = "cbc(paes)", + .test = alg_test_null, + .fips_allowed = 1, }, { .alg = "cbc(serpent)", .test = alg_test_skcipher, @@ -2727,6 +2734,13 @@ static const struct alg_test_desc alg_test_descs[] = { .dec = __VECS(des3_ede_ctr_dec_tv_template) } } + }, { + /* Same as ctr(aes) except the key is stored in + * hardware secure memory which we reference by index + */ + .alg = "ctr(paes)", + .test = alg_test_null, + .fips_allowed = 1, }, { .alg = "ctr(serpent)", .test = alg_test_skcipher, @@ -2997,6 +3011,13 @@ static const struct alg_test_desc alg_test_descs[] = { } } } + }, { + /* Same as ecb(aes) except the key is stored in + * hardware secure memory which we reference by index + */ + .alg = "ecb(paes)", + .test = alg_test_null, + .fips_allowed = 1, }, { .alg = "ecb(khazad)", .test = alg_test_skcipher, @@ -3324,6 +3345,13 @@ static const struct alg_test_desc alg_test_descs[] = { .dec = __VECS(aes_ofb_dec_tv_template) } } + }, { + /* Same as ofb(aes) except the key is stored in + * hardware secure memory which we reference by index + */ + .alg = "ofb(paes)", + .test = alg_test_null, + .fips_allowed = 1, }, { .alg = "pcbc(fcrypt)", .test = alg_test_skcipher, @@ -3581,6 +3609,21 @@ static const struct alg_test_desc alg_test_descs[] = { .dec = __VECS(aes_xts_dec_tv_template) } } + }, { + /* Same as xts(aes) except the key is stored in + * hardware secure memory which we reference by index + */ + .alg = "xts(paes)", + .test = alg_test_null, + .fips_allowed = 1, + }, { + .alg = "xts4096(paes)", + .test = alg_test_null, + .fips_allowed = 1, + }, { + .alg = "xts512(paes)", + .test = alg_test_null, + .fips_allowed = 1, }, { .alg = "xts(camellia)", .test = alg_test_skcipher, -- cgit v1.2.3-70-g09d2