Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qce - Set data unit size to message length for AES XTS transformation

Set the register REG_ENCR_XTS_DU_SIZE to cryptlen for AES XTS
transformation. Anything else causes the engine to return back
wrong results.

Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thara Gopinath and committed by
Herbert Xu
24cbcc94 25b71d61

+4 -4
+4 -4
drivers/crypto/qce/common.c
··· 295 295 { 296 296 u32 xtskey[QCE_MAX_CIPHER_KEY_SIZE / sizeof(u32)] = {0}; 297 297 unsigned int xtsklen = enckeylen / (2 * sizeof(u32)); 298 - unsigned int xtsdusize; 299 298 300 299 qce_cpu_to_be32p_array((__be32 *)xtskey, enckey + enckeylen / 2, 301 300 enckeylen / 2); 302 301 qce_write_array(qce, REG_ENCR_XTS_KEY0, xtskey, xtsklen); 303 302 304 - /* xts du size 512B */ 305 - xtsdusize = min_t(u32, QCE_SECTOR_SIZE, cryptlen); 306 - qce_write(qce, REG_ENCR_XTS_DU_SIZE, xtsdusize); 303 + /* Set data unit size to cryptlen. Anything else causes 304 + * crypto engine to return back incorrect results. 305 + */ 306 + qce_write(qce, REG_ENCR_XTS_DU_SIZE, cryptlen); 307 307 } 308 308 309 309 static int qce_setup_regs_skcipher(struct crypto_async_request *async_req,