Skip to contentSkip to conversation

crypto: caam: do not register AES-XTS mode on LP units

PATCH Superseded Sven Ebenfeld 2 participants 3 messages Nov 4, 2016 – Nov 7, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: caam: do not register AES-XTS mode on LP units

When using AES-XTS on a Wandboard, we receive a Mode error:
caam_jr 2102000.jr1: 20001311: CCB: desc idx 19: AES: Mode error.

Due to the Security Reference Manual, the Low Power AES units of the i.MX6 do not support the XTS mode. Therefore we should try to provide them them in the API.

---
 drivers/crypto/caam/caamalg.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/crypto/caam/caamalg.c +9 -0
index 156aad1..f5a63ba 100644
@@ -4583,6 +4583,15 @@ static int __init caam_algapi_init(void)
 		if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES))
 				continue;
 
+		/*
+		 * Check support for AES modes not available
+		 * on LP devices.
+		 */
+		if ((cha_vid & CHA_ID_LS_AES_MASK) == CHA_ID_LS_AES_LP)
+			if ((alg->class1_alg_type & OP_ALG_AAI_MASK) ==
+			     OP_ALG_AAI_XTS)
+				continue;
+
 		t_alg = caam_alg_alloc(alg);
 		if (IS_ERR(t_alg)) {
 			err = PTR_ERR(t_alg);
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Sven Ebenfeld

When using AES-XTS on a Wandboard, we receive a Mode error:
caam_jr 2102000.jr1: 20001311: CCB: desc idx 19: AES: Mode error.

Due to the Security Reference Manual, the Low Power AES units

s/Due to/According to

Quoted 3 lines

of the i.MX6 do not support the XTS mode. Therefore we should try to provide them them in the API.

Rephrase: Therefore we mustn't register XTS implementations to Crypto API in this case.

Quoted 1 line

Please send the patch to -stable and mention the offending commit:

Cc <[email protected]> # 4.4+
Fixes c6415a6016bf "crypto: caam - add support for acipher xts(aes)"

Thanks,
Horia

Quoted 25 lines
---
 drivers/crypto/caam/caamalg.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/crypto/caam/caamalg.c +9 -0
index 156aad1..f5a63ba 100644
@@ -4583,6 +4583,15 @@ static int __init caam_algapi_init(void)
 		if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES))
 				continue;
 
+		/*
+		 * Check support for AES modes not available
+		 * on LP devices.
+		 */
+		if ((cha_vid & CHA_ID_LS_AES_MASK) == CHA_ID_LS_AES_LP)
+			if ((alg->class1_alg_type & OP_ALG_AAI_MASK) ==
+			     OP_ALG_AAI_XTS)
+				continue;
+
 		t_alg = caam_alg_alloc(alg);
 		if (IS_ERR(t_alg)) {
 			err = PTR_ERR(t_alg);
#2 lore raw
Quoted 8 lines

-----Ursprüngliche Nachricht-----
Von: Horia Geanta Neag [mailto:[email protected]]
Gesendet: Montag, 7. November 2016 08:14
An: Sven Ebenfeld <[email protected]>; linux- [email protected]; [email protected]
Cc: [email protected]; [email protected]; Cata Vasile <[email protected]>
Betreff: Re: [PATCH] crypto: caam: do not register AES-XTS mode on LP

units

Quoted 15 lines · Sven Ebenfeld
Quoted 4 lines

When using AES-XTS on a Wandboard, we receive a Mode error:
caam_jr 2102000.jr1: 20001311: CCB: desc idx 19: AES: Mode error.

Due to the Security Reference Manual, the Low Power AES units

s/Due to/According to

Quoted 3 lines

of the i.MX6 do not support the XTS mode. Therefore we should try to provide them them in the API.

Rephrase: Therefore we mustn't register XTS implementations to Crypto API in this case.

Quoted 1 line
Quoted 8 lines

Please send the patch to -stable and mention the offending commit:

Cc <[email protected]> # 4.4+
Fixes c6415a6016bf "crypto: caam - add support for acipher xts(aes)"

Thanks,
Horia

Thanks, I've sent a v2.
Sven