<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/crypto/qce, branch v5.13-rc3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>crypto: qce - Remove totallen and offset in qce_start</title>
<updated>2021-03-07T04:13:17+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4139fd587320da311fca9c4da231dc850d4f4a22'/>
<id>4139fd587320da311fca9c4da231dc850d4f4a22</id>
<content type='text'>
totallen is used to get the size of the data to be transformed.
This is also available via nbytes or cryptlen in the qce_sha_reqctx
and qce_cipher_ctx. Similarly offset convey nothing for the supported
encryption and authentication transformations and is always 0.
Remove these two redundant parameters in qce_start.

Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
totallen is used to get the size of the data to be transformed.
This is also available via nbytes or cryptlen in the qce_sha_reqctx
and qce_cipher_ctx. Similarly offset convey nothing for the supported
encryption and authentication transformations and is always 0.
Remove these two redundant parameters in qce_start.

Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Remover src_tbl from qce_cipher_reqctx</title>
<updated>2021-03-07T04:13:17+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=62e4842842f3711b0674aa96742cfbec2c074d3f'/>
<id>62e4842842f3711b0674aa96742cfbec2c074d3f</id>
<content type='text'>
src_table is unused and hence remove it from struct qce_cipher_reqctx

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
src_table is unused and hence remove it from struct qce_cipher_reqctx

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Set data unit size to message length for AES XTS transformation</title>
<updated>2021-03-07T04:13:17+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=24cbcc9427a35ef95e2c7651a361e5b462f10b8e'/>
<id>24cbcc9427a35ef95e2c7651a361e5b462f10b8e</id>
<content type='text'>
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 &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Improve the conditions for requesting AES fallback cipher</title>
<updated>2021-03-07T04:13:16+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=25b71d61d6317212274b822e1cdbb03e499eea43'/>
<id>25b71d61d6317212274b822e1cdbb03e499eea43</id>
<content type='text'>
The following are the conditions for requesting AES fallback cipher.
	-  AES-192
	- AES-XTS request with len &lt;= 512 byte (Allow messages of length
	  less than 512 bytes for all other AES encryption algorithms other
	  than AES XTS)
	- AES-XTS request with len &gt; QCE_SECTOR_SIZE and is not a multiple
	  of it

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following are the conditions for requesting AES fallback cipher.
	-  AES-192
	- AES-XTS request with len &lt;= 512 byte (Allow messages of length
	  less than 512 bytes for all other AES encryption algorithms other
	  than AES XTS)
	- AES-XTS request with len &gt; QCE_SECTOR_SIZE and is not a multiple
	  of it

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Set ivsize to 0 for ecb(aes)</title>
<updated>2021-03-07T04:13:16+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=02d0dae3ce2adb5549c7f6c6e714181ed6ee100d'/>
<id>02d0dae3ce2adb5549c7f6c6e714181ed6ee100d</id>
<content type='text'>
ECB transformations do not have an IV and hence set the ivsize to 0 for
ecb(aes).

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ECB transformations do not have an IV and hence set the ivsize to 0 for
ecb(aes).

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Return error for non-blocksize data(ECB/CBC algorithms)</title>
<updated>2021-03-07T04:13:16+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=44b45cdea4e3d31a3be14fd7e2b8e1584b3e670c'/>
<id>44b45cdea4e3d31a3be14fd7e2b8e1584b3e670c</id>
<content type='text'>
ECB/CBC encryption/decryption requires the data to be blocksize aligned.
Crypto engine hangs on non-block sized operations for these algorithms.
Return invalid data if data size is not blocksize aligned for these
algorithms.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ECB/CBC encryption/decryption requires the data to be blocksize aligned.
Crypto engine hangs on non-block sized operations for these algorithms.
Return invalid data if data size is not blocksize aligned for these
algorithms.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Return error for zero length messages</title>
<updated>2021-03-07T04:13:16+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f08789462255d0a2858b1d600be4099a2980a328'/>
<id>f08789462255d0a2858b1d600be4099a2980a328</id>
<content type='text'>
Crypto engine BAM dma does not support 0 length data. Return unsupported
if zero length messages are passed for transformation.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Crypto engine BAM dma does not support 0 length data. Return unsupported
if zero length messages are passed for transformation.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Return unsupported if any three keys are same for DES3 algorithms</title>
<updated>2021-03-07T04:13:16+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=42f730a47beee3b8df9a55ed8a3009eb0fe5bd3f'/>
<id>42f730a47beee3b8df9a55ed8a3009eb0fe5bd3f</id>
<content type='text'>
Return unsupported if any three keys are same for DES3 algorithms
since CE does not support this and the operation causes the engine to
hang.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Return unsupported if any three keys are same for DES3 algorithms
since CE does not support this and the operation causes the engine to
hang.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Return unsupported if key1 and key 2 are same for AES XTS algorithm</title>
<updated>2021-03-07T04:13:16+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f0d078dd6c490535ccd7f1694813295dae99814e'/>
<id>f0d078dd6c490535ccd7f1694813295dae99814e</id>
<content type='text'>
Crypto engine does not support key1 = key2 for AES XTS algorithm; the
operation hangs the engines.  Return -EINVAL in case key1 and key2 are the
same.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Crypto engine does not support key1 = key2 for AES XTS algorithm; the
operation hangs the engines.  Return -EINVAL in case key1 and key2 are the
same.

Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: qce - Hold back a block of data to be transferred as part of final</title>
<updated>2021-03-07T04:13:15+00:00</updated>
<author>
<name>Thara Gopinath</name>
<email>thara.gopinath@linaro.org</email>
</author>
<published>2021-02-11T20:01:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=38de3cf21fc057f37ae6fb1f46a6fbe852792789'/>
<id>38de3cf21fc057f37ae6fb1f46a6fbe852792789</id>
<content type='text'>
If the available data to transfer is exactly a multiple of block size, save
the last block to be transferred in qce_ahash_final (with the last block
bit set) if this is indeed the end of data stream. If not this saved block
will be transferred as part of next update. If this block is not held back
and if this is indeed the end of data stream, the digest obtained will be
wrong since qce_ahash_final will see that rctx-&gt;buflen is 0 and return
doing nothing which in turn means that a digest will not be copied to the
destination result buffer.  qce_ahash_final cannot be made to alter this
behavior and allowed to proceed if rctx-&gt;buflen is 0 because the crypto
engine BAM does not allow for zero length transfers.

Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the available data to transfer is exactly a multiple of block size, save
the last block to be transferred in qce_ahash_final (with the last block
bit set) if this is indeed the end of data stream. If not this saved block
will be transferred as part of next update. If this block is not held back
and if this is indeed the end of data stream, the digest obtained will be
wrong since qce_ahash_final will see that rctx-&gt;buflen is 0 and return
doing nothing which in turn means that a digest will not be copied to the
destination result buffer.  qce_ahash_final cannot be made to alter this
behavior and allowed to proceed if rctx-&gt;buflen is 0 because the crypto
engine BAM does not allow for zero length transfers.

Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Thara Gopinath &lt;thara.gopinath@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
</feed>
