<?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>nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119742/nrf5340-cc312-rsa-2048-psa_asymmetric_encrypt-psa_alg_rsa_oaep-psa_alg_sha_256-error-issue</link><description>You are trying to perform RSA encryption using CC312 on the nRF5340, but the function: 
 
 returns -147 (PSA_ERROR_NOT_SUPPORTED) when CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y and CONFIG_PSA_CRYPTO_DRIVER_OBERON=n . 
 However, when CONFIG_PSA_CRYPTO_DRIVER_OBERON</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Mar 2025 11:56:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119742/nrf5340-cc312-rsa-2048-psa_asymmetric_encrypt-psa_alg_rsa_oaep-psa_alg_sha_256-error-issue" /><item><title>RE: nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/thread/527821?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 11:56:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c320e5a6-7351-4664-a5f7-9267ae66f40a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It looks like you need a larger RTT buffer. I get the whole log via RTT if I add these configs:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG_BACKEND_RTT=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=8192&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/thread/527487?ContentTypeID=1</link><pubDate>Sun, 16 Mar 2025 23:27:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4806f46-223c-477e-9c3b-067590529ee8</guid><dc:creator>giun.kim</dc:creator><description>&lt;p data-start="0" data-end="46"&gt;I&amp;#39;m testing it, and I think I might succeed.&lt;/p&gt;
&lt;p data-start="48" data-end="142"&gt;However, I encountered an issue during the debugging process and need your help to check it.&lt;/p&gt;
&lt;p data-start="144" data-end="233"&gt;It seems that the log is being truncated when printing the encrypted hex value via RTT.&lt;/p&gt;
&lt;p data-start="235" data-end="284" data-is-last-node="" data-is-only-node=""&gt;What would be the best way to resolve this issue?&lt;/p&gt;
&lt;div class="flex max-w-full flex-col flex-grow"&gt;
&lt;div dir="auto" data-message-author-role="assistant" data-message-id="46095e74-c419-496a-9860-e86b63b96910" data-message-model-slug="gpt-4o"&gt;
&lt;div&gt;
&lt;div class="markdown prose w-full break-words dark:prose-invert dark"&gt;
&lt;p data-start="0" data-end="76" data-is-last-node="" data-is-only-node=""&gt;Below are the applied configuration settings and the captured output screen.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="mb-2 flex gap-3 -ml-2"&gt;
&lt;div class="flex items-center justify-start rounded-xl p-1"&gt;
&lt;div&gt;
&lt;div class="flex items-center transition-opacity group-hover/turn:opacity-100 opacity-100"&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div class="flex"&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="hidden"&gt;&lt;/span&gt;
&lt;div class="flex items-center pb-0"&gt;&lt;span class="overflow-hidden text-clip whitespace-nowrap text-sm"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_MAIN_STACK_SIZE=20480
CONFIG_HEAP_MEM_POOL_SIZE=20480

 # Enable logging
CONFIG_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_USE_SEGGER_RTT=y

# 로깅 Config 시작
# CONFIG_LOG=y
# CONFIG_USE_SEGGER_RTT=y
# CONFIG_LOG_BACKEND_RTT=y
# CONFIG_LOG_BACKEND_UART=n
# CONFIG_LOG_BUFFER_SIZE=8192
# CONFIG_LOG_PRINTK=n
# CONFIG_LOG_MODE_DEFERRED=y

# CONFIG_LOG_MODE_IMMEDIATE=y
# CONFIG_LOG_PROCESS_THREAD=y
# CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=4096
# CONFIG_LOG_BACKEND_RTT_MODE_BLOCK=y
# CONFIG_LOG_STRDUP_MAX_STRING=512
# 로깅 Config 종료

# Enable nordic security backend and PSA APIs
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y

CONFIG_PSA_WANT_ALG_RSA_PKCS1V15_SIGN=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y
CONFIG_PSA_WANT_ALG_RSA_PKCS1V15_CRYPT=y

CONFIG_PSA_WANT_ALG_RSA_OAEP=y
CONFIG_PSA_WANT_ALG_SHA_256=y

# This samples source code explicitly uses an RSA key size of 4096
CONFIG_PSA_WANT_RSA_KEY_SIZE_2048=y
# CONFIG_PSA_WANT_RSA_KEY_SIZE_4096=y

# Config Clock Control 시작
CONFIG_SOC_ENABLE_LFXO=n

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y

CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
# Config Clock Control 종료&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1742167579272v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/thread/527337?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 09:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a6f1066-2671-4448-a960-32f4eaaeeae2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I origninally reproduced this issue by adding your code to the RSA sample, and that failes as you described. However, the reason is that the public key used in the sample is of the wrong size. with an updated 2048 bit public key (public_key_der) in&amp;nbsp;nrf/samples/crypto/rsa/src/key.h, encyrption is successfull.&lt;/p&gt;
&lt;p&gt;This is all the changes from the RSA sample in 2.9.1 (your changes except the fixed key size and UART instead of RTT logging):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/rsa_5F00_sample_5F00_2.9.1.diff"&gt;devzone.nordicsemi.com/.../rsa_5F00_sample_5F00_2.9.1.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And the resulting output, so this works as expected:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
[00:00:00.010,833] &amp;lt;inf&amp;gt; rsa: Starting the RSA example...
[00:00:00.016,693] &amp;lt;inf&amp;gt; rsa: Public key length = 270
[00:00:00.022,247] &amp;lt;inf&amp;gt; rsa: RSA Key Size (bytes): 256
[00:00:00.027,832] &amp;lt;inf&amp;gt; rsa: Encryption Buffer Size: 256
[00:00:00.033,691] &amp;lt;inf&amp;gt; rsa: Key Algorithm After Import: 0x7000309
[00:00:00.040,496] &amp;lt;inf&amp;gt; rsa: Max Plaintext Size: 190, Provided Plaintext Size: 16
[00:00:00.048,614] &amp;lt;inf&amp;gt; rsa: Key Type: 0x4001
[00:00:00.053,558] &amp;lt;inf&amp;gt; rsa: Key Algorithm: 0x7000309
[00:00:00.059,204] &amp;lt;inf&amp;gt; rsa: Key Usage Flags: 0x901
[00:00:00.064,666] &amp;lt;inf&amp;gt; rsa: Key Bits: 2048
[00:00:00.084,442] &amp;lt;inf&amp;gt; rsa: Encryption successful! Output Length: 256
[00:00:00.091,522] &amp;lt;inf&amp;gt; rsa: ---- Encrypted Data (len: 256): ----
[00:00:00.098,236] &amp;lt;inf&amp;gt; rsa: Content:
                              7d 51 9e 06 22 e6 11 28  92 c1 f8 d6 5e 39 13 03 |}Q..&amp;quot;..( ....^9..
                              38 3b 5b 7a fe 14 c9 5c  d0 33 3b 52 1b a6 73 f4 |8;[z...\ .3;R..s.
                              32 8a 96 d8 56 0f 03 43  98 d8 5e 71 22 19 d5 f5 |2...V..C ..^q&amp;quot;...
                              6f 06 55 98 96 0d 49 ed  82 73 0d db 32 8f b0 75 |o.U...I. .s..2..u
                              0f 55 24 91 29 5e a6 40  8b 7a 4d 41 78 43 05 64 |.U$.)^.@ .zMAxC.d
                              9e 0f 3c 7c 6d 34 b2 f2  6f bb c6 e9 2f 48 0e 7d |..&amp;lt;|m4.. o.../H.}
                              38 e2 0c 76 1f 40 50 d2  b1 0a 46 18 ee 42 9d ef |8..v.@P. ..F..B..
                              5b be 3c 82 3f 4b bf e4  e3 57 b0 0d 1f ff 7c 10 |[.&amp;lt;.?K.. .W....|.
                              97 d7 3c 92 4a 49 33 03  71 90 d6 69 f6 cb 06 fe |..&amp;lt;.JI3. q..i....
                              18 f2 11 3c aa 1f e4 08  3f ab cd 7c 89 f1 e5 77 |...&amp;lt;.... ?..|...w
                              47 fc a0 8a 09 1a 91 6d  cd 12 7d 5a 4c 2a a0 4a |G......m ..}ZL*.J
                              3a 89 e7 fb 57 f1 df 65  ec 9a 8c 9b e1 28 ec 9a |:...W..e .....(..
                              61 dd 3e d7 a8 82 49 5d  c3 87 c8 9b d2 0a cc 54 |a.&amp;gt;...I] .......T
                              f6 2e 26 51 c7 0d 7b 55  a1 7d 82 55 43 ec e5 95 |..&amp;amp;Q..{U .}.UC...
                              ca 15 96 2c c3 6e 6c da  0f e5 d7 00 c2 aa 8b bb |...,.nl. ........
                              27 bc 50 9c 33 8f 66 01  e6 02 fc 99 23 9c 95 24 |&amp;#39;.P.3.f. ....#..$
[00:00:00.242,279] &amp;lt;inf&amp;gt; rsa: ---- Encrypted Data end  ----
[00:00:00.248,352] &amp;lt;inf&amp;gt; rsa: Encryption failed: 0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(You print an error message here when&amp;nbsp;rsaEncrypt returns 0, but this is incorrect)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/thread/527227?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 15:14:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b37a299d-cb2d-4643-8e4c-ce41ce33fdcc</guid><dc:creator>giun.kim</dc:creator><description>&lt;p&gt;I initially suspected that my custom board had an issue, but even when I ran the RSA example with a 2.8V supply on the nRF5340 DK board, setting the board target to &lt;code&gt;cpuapp&lt;/code&gt;, the same issue occurred. Even when building with &lt;code&gt;_ns&lt;/code&gt;, key import works, but encryption does not proceed.&lt;/p&gt;
&lt;p&gt;My ultimate goal is to use the CC312 accelerator for RSA-2048 OAEP encryption and AES-CTR. I also suspect that &lt;code&gt;cpuapp&lt;/code&gt; and &lt;code&gt;cpuapp_ns&lt;/code&gt; are related to RSA encryption behavior.&lt;/p&gt;
&lt;p&gt;I have already spent two days on this issue and would appreciate a quick resolution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/thread/527218?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 14:52:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8871881-0f47-45ce-8a2f-d816eb481afd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks. I see the same on my end. According to the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/libraries/security/nrf_security/doc/driver_config.html#asymmetric_encryption_support"&gt;documentation&lt;/a&gt;, RSA OAEP should be supported with CryptoCell as well, and I am checking internally to understand more about this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/thread/527059?ContentTypeID=1</link><pubDate>Wed, 12 Mar 2025 23:29:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ece1c4a-b209-4372-8153-05f1d03edaa9</guid><dc:creator>giun.kim</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/64627.main.c"&gt;devzone.nordicsemi.com/.../64627.main.c&lt;/a&gt;&lt;/p&gt;
&lt;div class="flex max-w-full flex-col flex-grow"&gt;
&lt;div dir="auto" data-message-author-role="assistant" data-message-id="df29e2e2-0283-485d-aee0-56c7e42687c6" data-message-model-slug="gpt-4o"&gt;
&lt;div&gt;
&lt;div class="markdown prose w-full break-words dark:prose-invert dark"&gt;
&lt;p data-start="0" data-end="76" data-is-last-node="" data-is-only-node=""&gt;The version in use is 2.8, and the executed &lt;code data-start="44" data-end="52"&gt;main.c&lt;/code&gt; file has been uploaded.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="mb-2 flex gap-3 -ml-2"&gt;
&lt;div class="flex items-center justify-start rounded-xl p-1"&gt;
&lt;div class="flex items-center"&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div class="flex"&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741822149167v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="" data-state="closed"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="hidden"&gt;&lt;/span&gt;
&lt;div class="flex items-center pb-0"&gt;&lt;span class="overflow-hidden text-clip whitespace-nowrap text-sm"&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741822176343v2.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 CC312 RSA 2048 psa_asymmetric_encrypt PSA_ALG_RSA_OAEP(PSA_ALG_SHA_256) Error Issue</title><link>https://devzone.nordicsemi.com/thread/526995?ContentTypeID=1</link><pubDate>Wed, 12 Mar 2025 14:44:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad618e2b-a166-4d8f-a0ca-d1c100da18fb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which SDK version are you using? Can you share more of your crypto related code (like key generation or key import) so that I can attempt to reproduce the same on my end?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>