<?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>KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118434/kmu-psa-persistent-key-generation</link><description>We want to use PSA crypto to generate a persistent key that can&amp;#39;t be read out and use this for encryption/decryption. 
 We have of course tried the persistent_key_usage sample both with and without TF-M ITS. The problem for us is that when enabling TF</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Jul 2025 21:24:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118434/kmu-psa-persistent-key-generation" /><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/544153?ContentTypeID=1</link><pubDate>Wed, 30 Jul 2025 21:24:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0256afa9-1e84-44fb-b9f2-7de4fbbef991</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello Jan_Herr,&lt;/p&gt;
&lt;p&gt;As a support engineer, I can only say that I fully understand your frustration.&amp;nbsp;As mentioned,&amp;nbsp;we have registered the issue internally and will&amp;nbsp;get to it to improve the customer experience.&lt;/p&gt;
&lt;p&gt;If you have a Nordic sales contact, please drop a word with them as well. I am sure they&amp;nbsp;would want to understand customers&amp;#39; needs and frustrations.&lt;/p&gt;
&lt;p&gt;Our apologies for the inconvenience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/543890?ContentTypeID=1</link><pubDate>Tue, 29 Jul 2025 08:36:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e454000-8d0b-4705-92f6-2ae1fe5e9a02</guid><dc:creator>Jan_Herr</dc:creator><description>&lt;p&gt;Hi, we are also wondering about the same architectural decision, albeit on the nrf5340.&lt;br /&gt;Going into this, we actively chose an SoC with dedicated key storage for storing secrets there. I get that ITS needs to provide a mechanism for system w/o KMU but end of the day, we as customers are paying extra for the CC3xx module, aren&amp;#39;t we ?&lt;br /&gt;Finding out that this is not supported, even though the ecosystem is more or less entirely provided by ARM is rather annoying.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/541159?ContentTypeID=1</link><pubDate>Wed, 02 Jul 2025 11:42:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1ca5338-4240-4fc8-afa9-47afd4de649b</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;My apologies. I previously misunderstood that all your questions are resolved. While referring to this case today, I realized you have a question unanswered.&lt;/p&gt;
[quote user="Andreas u-blox"]Am I missing some config to keep the footprint down here because I can&amp;#39;t see how it would be worth wasting this much RAM/NVM just to be able to store some keys. Isn&amp;#39;t the purpose of the KMU exactly to keep the keys securly stored but with the main difference that it&amp;#39;s a HW block which cost no RAM/NVM?[/quote]
&lt;p&gt;Unfortunately, this is the case for now. The Crypto partition of TF-M depends on the ITS Partition (&lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/nrf/security/tfm/tfm_building.html#configurable_build"&gt;ref&lt;/a&gt;), so to enable crypto APIs, ITS must also be enabled. This&amp;nbsp;is a part of TF-M architecture, which is designed to&amp;nbsp;work with even devices without KMU.&lt;/p&gt;
&lt;p&gt;We have registered this issue in our backlog and will&amp;nbsp;try to improve this.&lt;/p&gt;
&lt;p&gt;Our apologies for the inconvenience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/522610?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 10:04:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81c1d5a4-5f8a-488d-914a-ab5d80fbb816</guid><dc:creator>Andreas u-blox</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Hieu!&lt;br /&gt;Sorry for not coming back to you sooner - had some urgent tasks I needed to do.&lt;br /&gt;Thank you very much for the patch! With it I can get the KMU slots to work both with and without TF-M enabled.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In our application we will just use one or two keys. We would like to use TF-M as long as the memory footprint isn&amp;#39;t too large. However, this is what I&amp;#39;m facing right now:&lt;br /&gt;If I enable&amp;nbsp;CONFIG_TFM_PROFILE_TYPE_MINIMAL the I get these numbers:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[191/195] Linking C executable bin/tfm_s.axf
Memory region         Used Size  Region Size  %age Used
           FLASH:       25660 B        26 KB     96.38%
             RAM:        9332 B        32 KB     28.48%&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;These&amp;nbsp;could be OK for us. I.e. TF-M only uses ~10 KB of RAM and I think CONFIG_PM_PARTITION_SIZE_TFM_SRAM can adjust the dedicated RAM area so that it doesn&amp;#39;t need to reserve the 32 KB it currently does.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The problem I&amp;#39;m facing is when I&amp;#39;m enabling&amp;nbsp;&lt;/span&gt;CONFIG_TFM_ITS_ENCRYPTED. This config doesn&amp;#39;t work with&amp;nbsp;&lt;span&gt;CONFIG_TFM_PROFILE_TYPE_MINIMAL so then when compiling I get this footprint:&lt;/span&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[245/249] Linking C executable bin/tfm_s.axf
Memory region         Used Size  Region Size  %age Used
           FLASH:       78096 B       254 KB     30.03%
             RAM:       56744 B        76 KB     72.91%&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It also needs the extra NVM partitions for the trusted storage not listed here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Am I missing some config to keep the footprint down here because I can&amp;#39;t see how it would be worth wasting this much RAM/NVM just to be able to store some keys. Isn&amp;#39;t the purpose of the KMU exactly to keep the keys securly stored but with the main difference that it&amp;#39;s a HW block which cost no RAM/NVM?&lt;/p&gt;
&lt;p&gt;The remaining problem I see now is that if we want to use TF-M I still need to enable&amp;nbsp;&lt;span&gt;CONFIG_TFM_ITS_ENCRYPTED even if I use the KMU to store the key resulting in the big mem footprint.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;/Andreas&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/522053?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2025 20:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6362a822-4701-4b20-9fc2-637e03bba1bf</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;Some colleagues helped me look into it.&amp;nbsp;There are a few issues that we need to address:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There is indeed a bug in NCS v2.9.0 that makes psa_cipher_encrypt() failed. It is fixed here with this PR:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/20199"&gt;https://github.com/nrfconnect/sdk-nrf/pull/20199&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can patch NCS with that PR, or try NCS main branch right now.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;ALG_CBC_NO_PADDING requires that the plain text is a multiple of the AES block size, 16. Therefore, please ensure this.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;There seems to be some issue with KMU slot 2 at the moment. We are looking into it. &lt;br /&gt;&lt;br /&gt;Meanwhile, please try some other slot, like 3 or 4.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Below I also attached my tested sample. Remember that it only works with PR 20199 patched.&lt;/p&gt;
&lt;p&gt;By the way, if you don&amp;#39;t mind sharing, our team would like to ask you about the reason you don&amp;#39;t want to use Trusted Storage. We hope it is not also some RAM consumption issue, which can be a little strange.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/c339750_5F00_persistent_5F00_key_5F00_usage_5F00_modified_5F00_kmu.zip"&gt;devzone.nordicsemi.com/.../c339750_5F00_persistent_5F00_key_5F00_usage_5F00_modified_5F00_kmu.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/521469?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 08:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:628e81d7-f3f3-401f-9af5-109b5ed47770</guid><dc:creator>Andreas u-blox</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;ok, understod. I thought the only difference between nRF54L15 and nRF54L10 was NVM and RAM size according to the &amp;quot;nRF54L Series SoC options&amp;quot; in link below, so I&amp;#39;m a bit supprised that TF-M is supported only for nRF54L15:&lt;br /&gt;&lt;a id="" href="https://www.nordicsemi.com/Products/nRF54L15"&gt;https://www.nordicsemi.com/Products/nRF54L15&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But let&amp;#39;s focus on getting the generated keys stored in KMU with TF-M disabled if that helps.&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/118434/kmu-psa-persistent-key-generation/521462"]Also, while we understood that you are concern about NVM and RAM consumption of TF-M[/quote]
&lt;p&gt;As I mentioned&amp;nbsp;when I enabled TF-M the&amp;nbsp;TF-M firmware consumed 40% of the RAM. This is RAM that we can&amp;#39;t use for our own app as it is dedicated for TF-M.&lt;/p&gt;
&lt;p&gt;But I think we&amp;#39;re getting a little out of topic. My question is how I get the things descripbed here to work:&lt;br /&gt;&lt;a id="" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/cryptography.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/cryptography.html&lt;/a&gt;&lt;br /&gt;I.e. can you provide a working config (with or without TF-M) that allows us to use the PSA crypto API to generate and store keys in a KMU slot?&lt;br /&gt;&lt;br /&gt;/Andreas&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/521462?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 08:37:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69391b9c-3844-4892-8542-7b36fd5f6b40</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;A colleague also points out that you are enabling TF-M for the nRF54L10, but I am not. I just built with the nrf54l15dk/nrf54l10/cpuapp target. That would explain the difference between your observation and mine.&lt;/p&gt;
&lt;p&gt;However, the problem is that TF-M isn&amp;#39;t supported on the nRF54L10 yet. See &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/releases_and_maturity/software_maturity.html#security_feature_support"&gt;this Security&amp;nbsp;Feature Support matrix&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Before we go further, can you proceed without TF-M for now?&lt;/p&gt;
&lt;p&gt;Also, while we understood that you are concern about NVM and RAM consumption of TF-M,&amp;nbsp;could you share why? This is to see if there are any alternatives that can help. Of course, as TF-M isn&amp;#39;t supported now, the point is a little moot.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/521302?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2025 12:45:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0309231-e52c-470e-8c61-6f0bcea94b24</guid><dc:creator>Andreas u-blox</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;If you use the persistent key storage example and build it for&amp;nbsp;nrf54l15dk/nrf54l15/cpuapp/ns it will, by default, enable Trusted Firmware ITS through the&amp;nbsp;&lt;span&gt;CONFIG_TFM_ITS_ENCRYPTED. When this is enabled TF-M will use a lot of RAM and it will also add the extra partitions for TF-M secure storage. This is exactly what we want to avoid, so maybe you can use hello world app as a starting point instead (this is what I used). In this way we can&amp;nbsp;make sure no other config is set.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Since the nRF54Lxx includes the Key Management Unit HW we want to store the keys directly in this HW instead of wasting a lot of RAM and flash using a software implementation of securly storing the keys using TF-M ITS. According to the doc&amp;nbsp; below, as I read it, the way to do this is to use the&amp;nbsp;&lt;span&gt;PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION() with&amp;nbsp;PSA_KEY_LOCATION_CRACEN_KMU when setting the lifetime by calling&amp;nbsp;psa_set_key_lifetime(). As far as I understand from the same doc I also need to use&amp;nbsp;&lt;span class="pre"&gt;PSA_KEY_HANDLE_FROM_CRACEN_KMU_SLOT(&lt;/span&gt;&lt;span class="pre"&gt;) when setting the key_id using&amp;nbsp;psa_set_key_id():&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/cryptography.html#programming_model_for_referencing_keys"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/cryptography.html#programming_model_for_referencing_keys&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="9456" url="~/f/nordic-q-a/118434/kmu-psa-persistent-key-generation/520943"]If I replace either the lifetime&amp;nbsp;attribute, or the algorithm attribute, or both, with the ones you used,&amp;nbsp;psa_cipher_encrypt() returns -135,&amp;nbsp;PSA_ERROR_INVALID_ARGUMENT.[/quote]
&lt;p&gt;I think when you don&amp;#39;t use these arguments the generated keys will be stored in TF-M ITS (Internal Trusted Storage) and not KMU. I have no problem running the Persistent key storage example without any modifications, the problem is that the keys then are stored in&amp;nbsp;the TF-M ITS and not KMU. The reason that you get&amp;nbsp;&lt;span&gt;PSA_ERROR_INVALID_ARGUMENT instead of&amp;nbsp;PSA_ERROR_NOT_SUPPORTED could maybe be that the&amp;nbsp;Persistent key storage example&amp;nbsp;sets CONFIG_TFM_ITS_ENCRYPTED which I don&amp;#39;t use.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/520943?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2025 20:25:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2aa9c25-1508-444f-afef-cdaedf607831</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;I was trying to reproduce your issue with the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/samples/crypto/persistent_key_usage/README.html"&gt;Crypto: Persistent key storage&lt;/a&gt;&amp;nbsp;sample.&amp;nbsp;I did run into issues, but not the one you have.&lt;/p&gt;
&lt;p&gt;If I replace either the lifetime&amp;nbsp;attribute, or the algorithm attribute, or both, with the ones you used,&amp;nbsp;psa_cipher_encrypt() returns -135,&amp;nbsp;PSA_ERROR_INVALID_ARGUMENT.&lt;/p&gt;
&lt;p&gt;The key generation itself works fine.&amp;nbsp;As this overall still failed, I will continue looking into it, but can you double check your setup to see if the key generation is working?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: KMU PSA persistent key generation</title><link>https://devzone.nordicsemi.com/thread/520616?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2025 18:33:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3baa26bc-3402-4238-a60f-b95de0fdbe64</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;I am&amp;nbsp;new to this feature.&amp;nbsp;Let me look into this a bit and I will get back to you this week.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>