summaryrefslogtreecommitdiffstats
path: root/crypto/testmgr.c
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2018-04-23 03:25:14 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2018-05-05 02:52:43 -0400
commita794d8d876d21d165721b5460264ca811245f5bd (patch)
tree6e052263b2ee918d639b94055c3466a4d3c2a3bc /crypto/testmgr.c
parent658c9d2b9f374c835d0348d852a3f002196628d0 (diff)
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 <gilad@benyossef.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r--crypto/testmgr.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 397b117309f1..c31da0f3f680 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -2582,6 +2582,13 @@ static const struct alg_test_desc alg_test_descs[] = {
2582 } 2582 }
2583 } 2583 }
2584 }, { 2584 }, {
2585 /* Same as cbc(aes) except the key is stored in
2586 * hardware secure memory which we reference by index
2587 */
2588 .alg = "cbc(paes)",
2589 .test = alg_test_null,
2590 .fips_allowed = 1,
2591 }, {
2585 .alg = "cbc(serpent)", 2592 .alg = "cbc(serpent)",
2586 .test = alg_test_skcipher, 2593 .test = alg_test_skcipher,
2587 .suite = { 2594 .suite = {
@@ -2728,6 +2735,13 @@ static const struct alg_test_desc alg_test_descs[] = {
2728 } 2735 }
2729 } 2736 }
2730 }, { 2737 }, {
2738 /* Same as ctr(aes) except the key is stored in
2739 * hardware secure memory which we reference by index
2740 */
2741 .alg = "ctr(paes)",
2742 .test = alg_test_null,
2743 .fips_allowed = 1,
2744 }, {
2731 .alg = "ctr(serpent)", 2745 .alg = "ctr(serpent)",
2732 .test = alg_test_skcipher, 2746 .test = alg_test_skcipher,
2733 .suite = { 2747 .suite = {
@@ -2998,6 +3012,13 @@ static const struct alg_test_desc alg_test_descs[] = {
2998 } 3012 }
2999 } 3013 }
3000 }, { 3014 }, {
3015 /* Same as ecb(aes) except the key is stored in
3016 * hardware secure memory which we reference by index
3017 */
3018 .alg = "ecb(paes)",
3019 .test = alg_test_null,
3020 .fips_allowed = 1,
3021 }, {
3001 .alg = "ecb(khazad)", 3022 .alg = "ecb(khazad)",
3002 .test = alg_test_skcipher, 3023 .test = alg_test_skcipher,
3003 .suite = { 3024 .suite = {
@@ -3325,6 +3346,13 @@ static const struct alg_test_desc alg_test_descs[] = {
3325 } 3346 }
3326 } 3347 }
3327 }, { 3348 }, {
3349 /* Same as ofb(aes) except the key is stored in
3350 * hardware secure memory which we reference by index
3351 */
3352 .alg = "ofb(paes)",
3353 .test = alg_test_null,
3354 .fips_allowed = 1,
3355 }, {
3328 .alg = "pcbc(fcrypt)", 3356 .alg = "pcbc(fcrypt)",
3329 .test = alg_test_skcipher, 3357 .test = alg_test_skcipher,
3330 .suite = { 3358 .suite = {
@@ -3582,6 +3610,21 @@ static const struct alg_test_desc alg_test_descs[] = {
3582 } 3610 }
3583 } 3611 }
3584 }, { 3612 }, {
3613 /* Same as xts(aes) except the key is stored in
3614 * hardware secure memory which we reference by index
3615 */
3616 .alg = "xts(paes)",
3617 .test = alg_test_null,
3618 .fips_allowed = 1,
3619 }, {
3620 .alg = "xts4096(paes)",
3621 .test = alg_test_null,
3622 .fips_allowed = 1,
3623 }, {
3624 .alg = "xts512(paes)",
3625 .test = alg_test_null,
3626 .fips_allowed = 1,
3627 }, {
3585 .alg = "xts(camellia)", 3628 .alg = "xts(camellia)",
3586 .test = alg_test_skcipher, 3629 .test = alg_test_skcipher,
3587 .suite = { 3630 .suite = {