<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96929/chacha20-without-poly1305-on-nrf-connect</link><description>Hey, 
 Does nRFConnect SDK support the ChaCha20 encryption library without Poly1305? 
 We are currently using the mbedTLS PSA Crypto library to perform encryption/decryption but it only works if we use the 16 byte authentication tag that is part of the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Mar 2023 08:20:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96929/chacha20-without-poly1305-on-nrf-connect" /><item><title>RE: ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/thread/412649?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 08:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:411cb2e0-8efa-4d97-a526-8df831a37fcc</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;ChaCha20 is a stream cipher that works on single bytes, so the length of the array does not matter. Also, if you pass a huge array, or several smaller chunks will not matter. The resulting encrypted text will be the same regardless. And as you see in the test code, different chunk sizes are used for decryption,&amp;nbsp;and that is also fine. Again, a stream cipher is byte based (rather than block based), so it does not matter.&lt;/p&gt;
&lt;p&gt;The code I uploaded was based on test code as mentioned, so I assume the reason for using different lengths there is to verify that it works with&amp;nbsp;different combinations of chunk sizes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/thread/412611?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 21:35:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1819eff-d53c-4573-88db-ce2efad8ee8b</guid><dc:creator>Bilal</dc:creator><description>&lt;p&gt;Thanks for that code - Ill try it out.&lt;/p&gt;
&lt;p&gt;Could u help me understand how the&amp;nbsp;length array is decided in the example code&amp;nbsp;you linked? what is the limitation of doing the entire encryption in one big chunk?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/thread/412561?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 14:50:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a53e9b89-ed07-4d7d-8669-6f067a6a611a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the delay. You can find an unofficial sample that demonstrate ChaCha20 only &lt;a href="https://github.com/einarthorsrud/random_ncs_samples/tree/main/chacha_without_poly"&gt;here&lt;/a&gt;. This is basically the test code I referred to in my previous post, with some minor changes. I tested this on the nRF52840 DK on nRF Connect SDK 2.2.0 and 2.3.0-rc2.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/thread/412367?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 22:25:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b07b17fb-6120-4a02-a076-b012680d7176</guid><dc:creator>Bilal</dc:creator><description>&lt;p&gt;Any updates? We are trying to upgrade a product that is already in production to nrf Connect SDK and it would be really helpful if we can keep using chacha20 without the poly1305 tag as that would cause alot of reworking and effort on our part.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/thread/411593?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 09:54:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a638bad-396b-426c-a5c9-14f445394f16</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;There is a test that demonstrate how this should work from an API perspective, specifically&amp;nbsp;psa_cipher_rfc7539_test() from&amp;nbsp;modules/tee/tf-m/tf-m-tests/test/secure_fw/suites/crypto/crypto_tests_common.c. This is not Nordic code though, and I am not able to get it to work myself. I am checking with our crypto team to see if there is a way to make it work. I will update here when I know more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/thread/411471?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 17:21:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e82fc3a-51d0-4a3a-ba5f-663b45b29b3b</guid><dc:creator>Bilal</dc:creator><description>&lt;p&gt;I am trying to do this but what&amp;nbsp;PSA function&amp;nbsp;should I be using.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We were using &amp;quot;psa_aead_encrypt&amp;quot; before w/ the algorithm set to&amp;nbsp;PSA_ALG_CHACHA20_POLY1305 but with&amp;nbsp;PSA_ALG_STREAM_CIPHER what API&amp;nbsp;should be used?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried &amp;quot;psa_cipher_encrypt&amp;quot; but I can&amp;#39;t find the source code for this function - I just see in the crypto.h header&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With that, I also am not sure how to specify&amp;nbsp;the nonce to use for the encryption.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Any help? Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ChaCha20 without Poly1305 on nRF Connect</title><link>https://devzone.nordicsemi.com/thread/411293?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 09:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5036fd1d-b4c8-4bda-9473-0f6bff4dcf09</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Using PSA API&amp;#39;s, it should be possible to use&amp;nbsp;PSA_ALG_STREAM_CIPHER as algorithm and&amp;nbsp;PSA_KEY_TYPE_CHACHA20 as key type.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>