<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/crypto/caam, branch v5.0.7</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>crypto: caam - fix DMA mapping of stack memory</title>
<updated>2019-03-23T19:11:12+00:00</updated>
<author>
<name>Horia Geantă</name>
<email>horia.geanta@nxp.com</email>
</author>
<published>2019-01-26T18:02:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6e905e258c50b32fdda68dff8a7686b8d2636ce7'/>
<id>6e905e258c50b32fdda68dff8a7686b8d2636ce7</id>
<content type='text'>
commit c19650d6ea99bcd903d3e55dd61860026c701339 upstream.

Roland reports the following issue and provides a root cause analysis:

"On a v4.19 i.MX6 system with IMA and CONFIG_DMA_API_DEBUG enabled, a
warning is generated when accessing files on a filesystem for which IMA
measurement is enabled:

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 1 at kernel/dma/debug.c:1181 check_for_stack.part.9+0xd0/0x120
    caam_jr 2101000.jr0: DMA-API: device driver maps memory from stack [addr=b668049e]
    Modules linked in:
    CPU: 0 PID: 1 Comm: switch_root Not tainted 4.19.0-20181214-1 #2
    Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    Backtrace:
    [&lt;c010efb8&gt;] (dump_backtrace) from [&lt;c010f2d0&gt;] (show_stack+0x20/0x24)
    [&lt;c010f2b0&gt;] (show_stack) from [&lt;c08b04f4&gt;] (dump_stack+0xa0/0xcc)
    [&lt;c08b0454&gt;] (dump_stack) from [&lt;c012b610&gt;] (__warn+0xf0/0x108)
    [&lt;c012b520&gt;] (__warn) from [&lt;c012b680&gt;] (warn_slowpath_fmt+0x58/0x74)
    [&lt;c012b62c&gt;] (warn_slowpath_fmt) from [&lt;c0199acc&gt;] (check_for_stack.part.9+0xd0/0x120)
    [&lt;c01999fc&gt;] (check_for_stack.part.9) from [&lt;c019a040&gt;] (debug_dma_map_page+0x144/0x174)
    [&lt;c0199efc&gt;] (debug_dma_map_page) from [&lt;c065f7f4&gt;] (ahash_final_ctx+0x5b4/0xcf0)
    [&lt;c065f240&gt;] (ahash_final_ctx) from [&lt;c065b3c4&gt;] (ahash_final+0x1c/0x20)
    [&lt;c065b3a8&gt;] (ahash_final) from [&lt;c03fe278&gt;] (crypto_ahash_op+0x38/0x80)
    [&lt;c03fe240&gt;] (crypto_ahash_op) from [&lt;c03fe2e0&gt;] (crypto_ahash_final+0x20/0x24)
    [&lt;c03fe2c0&gt;] (crypto_ahash_final) from [&lt;c03f19a8&gt;] (ima_calc_file_hash+0x29c/0xa40)
    [&lt;c03f170c&gt;] (ima_calc_file_hash) from [&lt;c03f2b24&gt;] (ima_collect_measurement+0x1dc/0x240)
    [&lt;c03f2948&gt;] (ima_collect_measurement) from [&lt;c03f0a60&gt;] (process_measurement+0x4c4/0x6b8)
    [&lt;c03f059c&gt;] (process_measurement) from [&lt;c03f0cdc&gt;] (ima_file_check+0x88/0xa4)
    [&lt;c03f0c54&gt;] (ima_file_check) from [&lt;c02d8adc&gt;] (path_openat+0x5d8/0x1364)
    [&lt;c02d8504&gt;] (path_openat) from [&lt;c02dad24&gt;] (do_filp_open+0x84/0xf0)
    [&lt;c02daca0&gt;] (do_filp_open) from [&lt;c02cf50c&gt;] (do_open_execat+0x84/0x1b0)
    [&lt;c02cf488&gt;] (do_open_execat) from [&lt;c02d1058&gt;] (__do_execve_file+0x43c/0x890)
    [&lt;c02d0c1c&gt;] (__do_execve_file) from [&lt;c02d1770&gt;] (sys_execve+0x44/0x4c)
    [&lt;c02d172c&gt;] (sys_execve) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x28)
    ---[ end trace 3455789a10e3aefd ]---

The cause is that the struct ahash_request *req is created as a
stack-local variable up in the stack (presumably somewhere in the IMA
implementation), then passed down into the CAAM driver, which tries to
dma_single_map the req-&gt;result (indirectly via map_seq_out_ptr_result)
in order to make that buffer available for the CAAM to store the result
of the following hash operation.

The calling code doesn't know how req will be used by the CAAM driver,
and there could be other such occurrences where stack memory is passed
down to the CAAM driver. Therefore we should rather fix this issue in
the CAAM driver where the requirements are known."

Fix this problem by:
-instructing the crypto engine to write the final hash in state-&gt;caam_ctx
-subsequently memcpy-ing the final hash into req-&gt;result

Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Reported-by: Roland Hieber &lt;rhi@pengutronix.de&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Tested-by: Roland Hieber &lt;rhi@pengutronix.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c19650d6ea99bcd903d3e55dd61860026c701339 upstream.

Roland reports the following issue and provides a root cause analysis:

"On a v4.19 i.MX6 system with IMA and CONFIG_DMA_API_DEBUG enabled, a
warning is generated when accessing files on a filesystem for which IMA
measurement is enabled:

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 1 at kernel/dma/debug.c:1181 check_for_stack.part.9+0xd0/0x120
    caam_jr 2101000.jr0: DMA-API: device driver maps memory from stack [addr=b668049e]
    Modules linked in:
    CPU: 0 PID: 1 Comm: switch_root Not tainted 4.19.0-20181214-1 #2
    Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    Backtrace:
    [&lt;c010efb8&gt;] (dump_backtrace) from [&lt;c010f2d0&gt;] (show_stack+0x20/0x24)
    [&lt;c010f2b0&gt;] (show_stack) from [&lt;c08b04f4&gt;] (dump_stack+0xa0/0xcc)
    [&lt;c08b0454&gt;] (dump_stack) from [&lt;c012b610&gt;] (__warn+0xf0/0x108)
    [&lt;c012b520&gt;] (__warn) from [&lt;c012b680&gt;] (warn_slowpath_fmt+0x58/0x74)
    [&lt;c012b62c&gt;] (warn_slowpath_fmt) from [&lt;c0199acc&gt;] (check_for_stack.part.9+0xd0/0x120)
    [&lt;c01999fc&gt;] (check_for_stack.part.9) from [&lt;c019a040&gt;] (debug_dma_map_page+0x144/0x174)
    [&lt;c0199efc&gt;] (debug_dma_map_page) from [&lt;c065f7f4&gt;] (ahash_final_ctx+0x5b4/0xcf0)
    [&lt;c065f240&gt;] (ahash_final_ctx) from [&lt;c065b3c4&gt;] (ahash_final+0x1c/0x20)
    [&lt;c065b3a8&gt;] (ahash_final) from [&lt;c03fe278&gt;] (crypto_ahash_op+0x38/0x80)
    [&lt;c03fe240&gt;] (crypto_ahash_op) from [&lt;c03fe2e0&gt;] (crypto_ahash_final+0x20/0x24)
    [&lt;c03fe2c0&gt;] (crypto_ahash_final) from [&lt;c03f19a8&gt;] (ima_calc_file_hash+0x29c/0xa40)
    [&lt;c03f170c&gt;] (ima_calc_file_hash) from [&lt;c03f2b24&gt;] (ima_collect_measurement+0x1dc/0x240)
    [&lt;c03f2948&gt;] (ima_collect_measurement) from [&lt;c03f0a60&gt;] (process_measurement+0x4c4/0x6b8)
    [&lt;c03f059c&gt;] (process_measurement) from [&lt;c03f0cdc&gt;] (ima_file_check+0x88/0xa4)
    [&lt;c03f0c54&gt;] (ima_file_check) from [&lt;c02d8adc&gt;] (path_openat+0x5d8/0x1364)
    [&lt;c02d8504&gt;] (path_openat) from [&lt;c02dad24&gt;] (do_filp_open+0x84/0xf0)
    [&lt;c02daca0&gt;] (do_filp_open) from [&lt;c02cf50c&gt;] (do_open_execat+0x84/0x1b0)
    [&lt;c02cf488&gt;] (do_open_execat) from [&lt;c02d1058&gt;] (__do_execve_file+0x43c/0x890)
    [&lt;c02d0c1c&gt;] (__do_execve_file) from [&lt;c02d1770&gt;] (sys_execve+0x44/0x4c)
    [&lt;c02d172c&gt;] (sys_execve) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x28)
    ---[ end trace 3455789a10e3aefd ]---

The cause is that the struct ahash_request *req is created as a
stack-local variable up in the stack (presumably somewhere in the IMA
implementation), then passed down into the CAAM driver, which tries to
dma_single_map the req-&gt;result (indirectly via map_seq_out_ptr_result)
in order to make that buffer available for the CAAM to store the result
of the following hash operation.

The calling code doesn't know how req will be used by the CAAM driver,
and there could be other such occurrences where stack memory is passed
down to the CAAM driver. Therefore we should rather fix this issue in
the CAAM driver where the requirements are known."

Fix this problem by:
-instructing the crypto engine to write the final hash in state-&gt;caam_ctx
-subsequently memcpy-ing the final hash into req-&gt;result

Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Reported-by: Roland Hieber &lt;rhi@pengutronix.de&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Tested-by: Roland Hieber &lt;rhi@pengutronix.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam - fixed handling of sg list</title>
<updated>2019-03-23T19:11:12+00:00</updated>
<author>
<name>Pankaj Gupta</name>
<email>pankaj.gupta@nxp.com</email>
</author>
<published>2019-02-01T07:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e86dc780320e586fb1a30536f2b017fc7a4beb9c'/>
<id>e86dc780320e586fb1a30536f2b017fc7a4beb9c</id>
<content type='text'>
commit 42e95d1f10dcf8b18b1d7f52f7068985b3dc5b79 upstream.

when the source sg contains more than 1 fragment and
destination sg contains 1 fragment, the caam driver
mishandle the buffers to be sent to caam.

Fixes: f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc: &lt;stable@vger.kernel.org&gt; # 4.2+
Signed-off-by: Pankaj Gupta &lt;pankaj.gupta@nxp.com&gt;
Signed-off-by: Arun Pathak &lt;arun.pathak@nxp.com&gt;
Reviewed-by: Horia Geanta &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 42e95d1f10dcf8b18b1d7f52f7068985b3dc5b79 upstream.

when the source sg contains more than 1 fragment and
destination sg contains 1 fragment, the caam driver
mishandle the buffers to be sent to caam.

Fixes: f2147b88b2b1 ("crypto: caam - Convert GCM to new AEAD interface")
Cc: &lt;stable@vger.kernel.org&gt; # 4.2+
Signed-off-by: Pankaj Gupta &lt;pankaj.gupta@nxp.com&gt;
Signed-off-by: Arun Pathak &lt;arun.pathak@nxp.com&gt;
Reviewed-by: Horia Geanta &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam - fix hash context DMA unmap size</title>
<updated>2019-03-23T19:11:12+00:00</updated>
<author>
<name>Franck LENORMAND</name>
<email>franck.lenormand@nxp.com</email>
</author>
<published>2019-02-19T14:56:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fce3d391401a0fd25955a02a4a4577c7eae85aeb'/>
<id>fce3d391401a0fd25955a02a4a4577c7eae85aeb</id>
<content type='text'>
commit 65055e2108847af5e577cc7ce6bde45ea136d29a upstream.

When driver started using state-&gt;caam_ctxt for storing both running hash
and final hash, it was not updated to handle different DMA unmap
lengths.

Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Fixes: c19650d6ea99 ("crypto: caam - fix DMA mapping of stack memory")
Signed-off-by: Franck LENORMAND &lt;franck.lenormand@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 65055e2108847af5e577cc7ce6bde45ea136d29a upstream.

When driver started using state-&gt;caam_ctxt for storing both running hash
and final hash, it was not updated to handle different DMA unmap
lengths.

Cc: &lt;stable@vger.kernel.org&gt; # v4.19+
Fixes: c19650d6ea99 ("crypto: caam - fix DMA mapping of stack memory")
Signed-off-by: Franck LENORMAND &lt;franck.lenormand@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam - fix SHA support detection</title>
<updated>2019-01-10T13:37:31+00:00</updated>
<author>
<name>Horia Geantă</name>
<email>horia.geanta@nxp.com</email>
</author>
<published>2018-12-21T12:47:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2dd3fde41bf3dc68e38de23da87e72a07719b708'/>
<id>2dd3fde41bf3dc68e38de23da87e72a07719b708</id>
<content type='text'>
The addition of Chacha20 + Poly1305 authenc support inadvertently broke
detection of algorithms supported by MDHA (Message Digest Hardware
Accelerator), fix it.

Fixes: d6bbd4eea243 ("crypto: caam/jr - add support for Chacha20 + Poly1305")
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&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 addition of Chacha20 + Poly1305 authenc support inadvertently broke
detection of algorithms supported by MDHA (Message Digest Hardware
Accelerator), fix it.

Fixes: d6bbd4eea243 ("crypto: caam/jr - add support for Chacha20 + Poly1305")
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam - fix zero-length buffer DMA mapping</title>
<updated>2019-01-10T13:37:31+00:00</updated>
<author>
<name>Aymen Sghaier</name>
<email>aymen.sghaier@nxp.com</email>
</author>
<published>2018-12-19T14:36:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=04e6d25c5bb244c1a37eb9fe0b604cc11a04e8c5'/>
<id>04e6d25c5bb244c1a37eb9fe0b604cc11a04e8c5</id>
<content type='text'>
Recent changes - probably DMA API related (generic and/or arm64-specific) -
exposed a case where driver maps a zero-length buffer:
ahash_init()-&gt;ahash_update()-&gt;ahash_final() with a zero-length string to
hash

kernel BUG at kernel/dma/swiotlb.c:475!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 1823 Comm: cryptomgr_test Not tainted 4.20.0-rc1-00108-g00c9fe37a7f2 #1
Hardware name: LS1046A RDB Board (DT)
pstate: 80000005 (Nzcv daif -PAN -UAO)
pc : swiotlb_tbl_map_single+0x170/0x2b8
lr : swiotlb_map_page+0x134/0x1f8
sp : ffff00000f79b8f0
x29: ffff00000f79b8f0 x28: 0000000000000000
x27: ffff0000093d0000 x26: 0000000000000000
x25: 00000000001f3ffe x24: 0000000000200000
x23: 0000000000000000 x22: 00000009f2c538c0
x21: ffff800970aeb410 x20: 0000000000000001
x19: ffff800970aeb410 x18: 0000000000000007
x17: 000000000000000e x16: 0000000000000001
x15: 0000000000000019 x14: c32cb8218a167fe8
x13: ffffffff00000000 x12: ffff80097fdae348
x11: 0000800976bca000 x10: 0000000000000010
x9 : 0000000000000000 x8 : ffff0000091fd6c8
x7 : 0000000000000000 x6 : 00000009f2c538bf
x5 : 0000000000000000 x4 : 0000000000000001
x3 : 0000000000000000 x2 : 00000009f2c538c0
x1 : 00000000f9fff000 x0 : 0000000000000000
Process cryptomgr_test (pid: 1823, stack limit = 0x(____ptrval____))
Call trace:
 swiotlb_tbl_map_single+0x170/0x2b8
 swiotlb_map_page+0x134/0x1f8
 ahash_final_no_ctx+0xc4/0x6cc
 ahash_final+0x10/0x18
 crypto_ahash_op+0x30/0x84
 crypto_ahash_final+0x14/0x1c
 __test_hash+0x574/0xe0c
 test_hash+0x28/0x80
 __alg_test_hash+0x84/0xd0
 alg_test_hash+0x78/0x144
 alg_test.part.30+0x12c/0x2b4
 alg_test+0x3c/0x68
 cryptomgr_test+0x44/0x4c
 kthread+0xfc/0x128
 ret_from_fork+0x10/0x18
Code: d34bfc18 2a1a03f7 1a9f8694 35fff89a (d4210000)

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Aymen Sghaier &lt;aymen.sghaier@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&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>
Recent changes - probably DMA API related (generic and/or arm64-specific) -
exposed a case where driver maps a zero-length buffer:
ahash_init()-&gt;ahash_update()-&gt;ahash_final() with a zero-length string to
hash

kernel BUG at kernel/dma/swiotlb.c:475!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 1823 Comm: cryptomgr_test Not tainted 4.20.0-rc1-00108-g00c9fe37a7f2 #1
Hardware name: LS1046A RDB Board (DT)
pstate: 80000005 (Nzcv daif -PAN -UAO)
pc : swiotlb_tbl_map_single+0x170/0x2b8
lr : swiotlb_map_page+0x134/0x1f8
sp : ffff00000f79b8f0
x29: ffff00000f79b8f0 x28: 0000000000000000
x27: ffff0000093d0000 x26: 0000000000000000
x25: 00000000001f3ffe x24: 0000000000200000
x23: 0000000000000000 x22: 00000009f2c538c0
x21: ffff800970aeb410 x20: 0000000000000001
x19: ffff800970aeb410 x18: 0000000000000007
x17: 000000000000000e x16: 0000000000000001
x15: 0000000000000019 x14: c32cb8218a167fe8
x13: ffffffff00000000 x12: ffff80097fdae348
x11: 0000800976bca000 x10: 0000000000000010
x9 : 0000000000000000 x8 : ffff0000091fd6c8
x7 : 0000000000000000 x6 : 00000009f2c538bf
x5 : 0000000000000000 x4 : 0000000000000001
x3 : 0000000000000000 x2 : 00000009f2c538c0
x1 : 00000000f9fff000 x0 : 0000000000000000
Process cryptomgr_test (pid: 1823, stack limit = 0x(____ptrval____))
Call trace:
 swiotlb_tbl_map_single+0x170/0x2b8
 swiotlb_map_page+0x134/0x1f8
 ahash_final_no_ctx+0xc4/0x6cc
 ahash_final+0x10/0x18
 crypto_ahash_op+0x30/0x84
 crypto_ahash_final+0x14/0x1c
 __test_hash+0x574/0xe0c
 test_hash+0x28/0x80
 __alg_test_hash+0x84/0xd0
 alg_test_hash+0x78/0x144
 alg_test.part.30+0x12c/0x2b4
 alg_test+0x3c/0x68
 cryptomgr_test+0x44/0x4c
 kthread+0xfc/0x128
 ret_from_fork+0x10/0x18
Code: d34bfc18 2a1a03f7 1a9f8694 35fff89a (d4210000)

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Aymen Sghaier &lt;aymen.sghaier@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: chacha20-generic - refactor to allow varying number of rounds</title>
<updated>2018-11-20T06:26:55+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2018-11-17T01:26:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1ca1b917940c24ca3d1f490118c5474168622953'/>
<id>1ca1b917940c24ca3d1f490118c5474168622953</id>
<content type='text'>
In preparation for adding XChaCha12 support, rename/refactor
chacha20-generic to support different numbers of rounds.  The
justification for needing XChaCha12 support is explained in more detail
in the patch "crypto: chacha - add XChaCha12 support".

The only difference between ChaCha{8,12,20} are the number of rounds
itself; all other parts of the algorithm are the same.  Therefore,
remove the "20" from all definitions, structures, functions, files, etc.
that will be shared by all ChaCha versions.

Also make -&gt;setkey() store the round count in the chacha_ctx (previously
chacha20_ctx).  The generic code then passes the round count through to
chacha_block().  There will be a -&gt;setkey() function for each explicitly
allowed round count; the encrypt/decrypt functions will be the same.  I
decided not to do it the opposite way (same -&gt;setkey() function for all
round counts, with different encrypt/decrypt functions) because that
would have required more boilerplate code in architecture-specific
implementations of ChaCha and XChaCha.

Reviewed-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Acked-by: Martin Willi &lt;martin@strongswan.org&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&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>
In preparation for adding XChaCha12 support, rename/refactor
chacha20-generic to support different numbers of rounds.  The
justification for needing XChaCha12 support is explained in more detail
in the patch "crypto: chacha - add XChaCha12 support".

The only difference between ChaCha{8,12,20} are the number of rounds
itself; all other parts of the algorithm are the same.  Therefore,
remove the "20" from all definitions, structures, functions, files, etc.
that will be shared by all ChaCha versions.

Also make -&gt;setkey() store the round count in the chacha_ctx (previously
chacha20_ctx).  The generic code then passes the round count through to
chacha_block().  There will be a -&gt;setkey() function for each explicitly
allowed round count; the encrypt/decrypt functions will be the same.  I
decided not to do it the opposite way (same -&gt;setkey() function for all
round counts, with different encrypt/decrypt functions) because that
would have required more boilerplate code in architecture-specific
implementations of ChaCha and XChaCha.

Reviewed-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Acked-by: Martin Willi &lt;martin@strongswan.org&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam/qi2 - add support for Chacha20 + Poly1305</title>
<updated>2018-11-16T06:11:03+00:00</updated>
<author>
<name>Horia Geantă</name>
<email>horia.geanta@nxp.com</email>
</author>
<published>2018-11-08T13:36:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c10a53367901b36eec6208f1dbaf53da9fd358bb'/>
<id>c10a53367901b36eec6208f1dbaf53da9fd358bb</id>
<content type='text'>
Add support for Chacha20 + Poly1305 combined AEAD:
-generic (rfc7539)
-IPsec (rfc7634 - known as rfc7539esp in the kernel)

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&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>
Add support for Chacha20 + Poly1305 combined AEAD:
-generic (rfc7539)
-IPsec (rfc7634 - known as rfc7539esp in the kernel)

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam/jr - add support for Chacha20 + Poly1305</title>
<updated>2018-11-16T06:11:03+00:00</updated>
<author>
<name>Horia Geantă</name>
<email>horia.geanta@nxp.com</email>
</author>
<published>2018-11-08T13:36:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d6bbd4eea243951d2543a0f427c9a6bf2835b6f5'/>
<id>d6bbd4eea243951d2543a0f427c9a6bf2835b6f5</id>
<content type='text'>
Add support for Chacha20 + Poly1305 combined AEAD:
-generic (rfc7539)
-IPsec (rfc7634 - known as rfc7539esp in the kernel)

Signed-off-by: Cristian Stoica &lt;cristian.stoica@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&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>
Add support for Chacha20 + Poly1305 combined AEAD:
-generic (rfc7539)
-IPsec (rfc7634 - known as rfc7539esp in the kernel)

Signed-off-by: Cristian Stoica &lt;cristian.stoica@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam/qi2 - add support for ChaCha20</title>
<updated>2018-11-16T06:11:03+00:00</updated>
<author>
<name>Horia Geantă</name>
<email>horia.geanta@nxp.com</email>
</author>
<published>2018-11-08T13:36:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c99d4a2454009d6fb51e03248fac7629c4d6a5ca'/>
<id>c99d4a2454009d6fb51e03248fac7629c4d6a5ca</id>
<content type='text'>
Add support for ChaCha20 skcipher algorithm.

Signed-off-by: Carmen Iorga &lt;carmen.iorga@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&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>
Add support for ChaCha20 skcipher algorithm.

Signed-off-by: Carmen Iorga &lt;carmen.iorga@nxp.com&gt;
Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crypto: caam - add register map changes cf. Era 10</title>
<updated>2018-11-16T06:11:03+00:00</updated>
<author>
<name>Horia Geantă</name>
<email>horia.geanta@nxp.com</email>
</author>
<published>2018-11-08T13:36:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d239b10d4ceb986d998779a4ed81824368aca831'/>
<id>d239b10d4ceb986d998779a4ed81824368aca831</id>
<content type='text'>
Era 10 changes the register map.

The updates that affect the drivers:
-new version registers are added
-DBG_DBG[deco_state] field is moved to a new register -
DBG_EXEC[19:16] @ 8_0E3Ch.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&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>
Era 10 changes the register map.

The updates that affect the drivers:
-new version registers are added
-DBG_DBG[deco_state] field is moved to a new register -
DBG_EXEC[19:16] @ 8_0E3Ch.

Signed-off-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</pre>
</div>
</content>
</entry>
</feed>
