<?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>Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90042/using-sha256-with-simple-mqtt</link><description>Hello, i want to use SHA-256 to encrypt a Payload of my outgoing MQTT Messages. 
 I started to modify the NRF9160 MQTT Example. To test the encryption i copied Code from the sha256 Example. 
 The psa_crypto_init() will succeed but when i try to use psa_hash_compute</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Jul 2022 15:37:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90042/using-sha256-with-simple-mqtt" /><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/378769?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 15:37:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e8b1465-e1a2-4901-971b-57ae7d56f87b</guid><dc:creator>Schmid</dc:creator><description>&lt;p&gt;After i saw that the Example is working on your machine i reinstalled everything related to NRF and now it is working.&lt;/p&gt;
&lt;p&gt;Thanks for your Help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/378760?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 14:47:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f081413-2a21-4982-bd21-0014d50fc10d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;When I run your project, this is the log I get, and it seems like it works fine.&lt;br /&gt;Do you get something else in the log?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.544,158] &amp;lt;inf&amp;gt; mqtt_simple: The MQTT simple sample started
[00:00:00.544,189] &amp;lt;inf&amp;gt; mqtt_simple: Starting SHA256 example...
[00:00:00.544,189] &amp;lt;inf&amp;gt; mqtt_simple: Hashing using SHA256...
[00:00:00.544,342] &amp;lt;inf&amp;gt; mqtt_simple: Hashing successful!
[00:00:00.544,372] &amp;lt;inf&amp;gt; mqtt_simple: ---- Plaintext (len: 100): ----
[00:00:00.544,403] &amp;lt;inf&amp;gt; mqtt_simple: Content:
                                      45 78 61 6d 70 6c 65 20  73 74 72 69 6e 67 20 74 |Example  string t
                                      6f 20 64 65 6d 6f 6e 73  74 72 61 74 65 20 62 61 |o demons trate ba
                                      73 69 63 20 75 73 61 67  65 20 6f 66 20 53 48 41 |sic usag e of SHA
                                      32 35 36 2e 00 00 00 00  00 00 00 00 00 00 00 00 |256..... ........
                                      00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 |........ ........
                                      00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 |........ ........
                                      00 00 00 00                                      |....             
[00:00:00.544,403] &amp;lt;inf&amp;gt; mqtt_simple: ---- Plaintext end  ----
[00:00:00.544,433] &amp;lt;inf&amp;gt; mqtt_simple: ---- SHA256 hash (len: 32): ----
[00:00:00.544,433] &amp;lt;inf&amp;gt; mqtt_simple: Content:
                                      1f a2 7b 31 e2 4c c0 e3  f6 d8 d5 ab f6 1d 87 9f |..{1.L.. ........
                                      fb cb cc 2d d4 9c 49 ab  59 cf 9e 54 c2 80 65 56 |...-..I. Y..T..eV
[00:00:00.544,464] &amp;lt;inf&amp;gt; mqtt_simple: ---- SHA256 hash end  ----
[00:00:00.544,464] &amp;lt;inf&amp;gt; mqtt_simple: Verifying the SHA256 hash...
[00:00:00.544,647] &amp;lt;inf&amp;gt; mqtt_simple: SHA256 verification successful!
[00:00:00.544,647] &amp;lt;inf&amp;gt; mqtt_simple: Example finished successfully!
[00:00:00.544,647] &amp;lt;inf&amp;gt; mqtt_simple: Disabling PSM and eDRX
[00:00:00.551,605] &amp;lt;inf&amp;gt; mqtt_simple: LTE Link Connecting...
[00:00:03.630,035] &amp;lt;inf&amp;gt; mqtt_simple: LTE Link Connected!
[00:00:03.770,172] &amp;lt;inf&amp;gt; mqtt_simple: IPv4 Address found 137.135.83.217
[00:00:03.770,629] &amp;lt;dbg&amp;gt; mqtt_simple: client_id_get: client_id = nrf-352656109434228
[00:00:04.178,894] &amp;lt;inf&amp;gt; mqtt_simple: MQTT client connected
[00:00:04.178,894] &amp;lt;inf&amp;gt; mqtt_simple: Subscribing to: my/subscribe/topic len 18
[00:00:04.420,806] &amp;lt;inf&amp;gt; mqtt_simple: SUBACK packet id: 1234&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/378515?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 11:02:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0465643e-61ea-45b9-b3df-929ef94c81bc</guid><dc:creator>Schmid</dc:creator><description>&lt;p&gt;I recreated my Project combining the mqtt_simple and sha256 examples.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7870.mqtt_5F00_simple.zip"&gt;devzone.nordicsemi.com/.../7870.mqtt_5F00_simple.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/378125?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 13:43:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fa8b936-437f-491c-81c6-c07bab22ee50</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have not been able to find an issue with this yet.&lt;/p&gt;
&lt;p&gt;Could you zip your project files and upload them here, so that I can try to replicate the issue?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/377928?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2022 15:53:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b6df3bb-fb8d-4cdc-9060-4a2afa679aa2</guid><dc:creator>Schmid</dc:creator><description>&lt;p&gt;Thank you for your Help.&lt;/p&gt;
&lt;p&gt;I added CONFIG_PSA_CRYPTO_DRIVER_ALG_SHA_256_CC3XX, i also already had CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y enabled in my config but the error stays. The input_length should be okay since i use the same code with the same string from the sha256-examle (which runs without error).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/377677?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 14:12:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e30bcaf7-ec58-4d55-a27d-288632ca1575</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;From &lt;a href="https://armmbed.github.io/mbed-crypto/html/api/ops/hashes.html#c.psa_hash_compute"&gt;psa_hash_compute()&lt;/a&gt;: &lt;br /&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a title="PSA_ERROR_NOT_SUPPORTED" href="https://armmbed.github.io/mbed-crypto/html/api/library/status.html#c.PSA_ERROR_NOT_SUPPORTED"&gt;&lt;code&gt;&lt;span&gt;PSA_ERROR_NOT_SUPPORTED&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The following conditions can result in this error:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&lt;span&gt;alg&lt;/span&gt;&lt;/code&gt; is not supported or is not a hash algorithm.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&lt;span&gt;input_length&lt;/span&gt;&lt;/code&gt; is too large for the implementation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;For the first one: Is &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_PSA_CRYPTO_DRIVER_ALG_SHA_256_CC3XX"&gt;CONFIG_PSA_CRYPTO_DRIVER_ALG_SHA_256_CC3XX&lt;/a&gt; enabled?&lt;/p&gt;
&lt;p&gt;For the second one: Are you sure that the input length is not too long?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/377550?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 08:58:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec6e57bf-f91d-4c73-bd8e-d39418a130a6</guid><dc:creator>Schmid</dc:creator><description>&lt;p&gt;Hello, this is my current conf&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# Modem library
CONFIG_NRF_MODEM_LIB=y

# Disable Modem traces, since we need UART1 for HCI
CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=n

# AT host
CONFIG_AT_HOST_LIBRARY=y

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=y
CONFIG_MQTT_CLEAN_SESSION=y

# Application
# CONFIG_MQTT_PUB_TOPIC=&amp;quot;my/publish/topic&amp;quot;
# CONFIG_MQTT_SUB_TOPIC=&amp;quot;my/subscribe/topic&amp;quot;
# CONFIG_MQTT_CLIENT_ID=&amp;quot;my-client-id&amp;quot;
# CONFIG_MQTT_BROKER_HOSTNAME=&amp;quot;mqtt.eclipseprojects.io&amp;quot;
# CONFIG_MQTT_BROKER_PORT=1883

# Button support
CONFIG_DK_LIBRARY=y

# Enable logging
CONFIG_LOG=y
CONFIG_MQTT_SIMPLE_LOG_LEVEL_DBG=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# NewLib C
CONFIG_NEWLIB_LIBC=y
CONFIG_MQTT_BROKER_HOSTNAME=&amp;quot;dev-gateway.keyota.de&amp;quot;
CONFIG_MQTT_BROKER_PORT=8883
CONFIG_MODEM_KEY_MGMT=y
CONFIG_MODEM_ANTENNA_AT_MAGPIO=&amp;quot;AT%XMAGPIO=1,0,0,1,1,1574,1577&amp;quot;
CONFIG_MODEM_ANTENNA_AT_COEX0=&amp;quot;AT%XCOEX0=1,1,1565,1586&amp;quot;
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_MQTT_CLIENT_ID=&amp;quot;860016040397437&amp;quot;
CONFIG_BUTTON_EVENT_PUBLISH_MSG=&amp;quot;456789:EA4712FF4380FF&amp;quot;
CONFIG_MQTT_SUB_TOPIC=&amp;quot;1/lock/860016040397437_456789&amp;quot;
CONFIG_MQTT_PUB_TOPIC=&amp;quot;1/gateway/860016040397437&amp;quot;

# Enable Bluetooth stack and libraries
CONFIG_BT=y
CONFIG_BT_H4=y
CONFIG_BT_WAIT_NOP=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DM=y
CONFIG_BT_SCAN=y
CONFIG_BT_SCAN_FILTER_ENABLE=y
CONFIG_BT_SCAN_UUID_CNT=1

CONFIG_UART_INTERRUPT_DRIVEN=y

# Enable nordic security backend and PSA APIs
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y

CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y

CONFIG_NRF_SW_LPUART=y
CONFIG_NRF_SW_LPUART_INT_DRIVEN=y

CONFIG_UART_2_ASYNC=y
CONFIG_UART_2_INTERRUPT_DRIVEN=n
CONFIG_UART_2_NRF_HW_ASYNC=y
CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i tried to add&lt;/p&gt;
&lt;div style="background-color:#2b2b2b;color:#a9b7c6;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#a9b7c6;"&gt;CONFIG_BUILD_WITH_TFM=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#a9b7c6;"&gt;CONFIG_NORDIC_SECURITY_BACKEND=y&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;but nothing changed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using SHA256 with Simple MQTT</title><link>https://devzone.nordicsemi.com/thread/377194?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2022 12:23:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2274fdd-1c27-41bd-b2ea-88f03d6e4d94</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Philipp&lt;/p&gt;
[quote user=""]To fix this i tried to modify the prj.conf with configs i found in other Devzone Threads but it wont change the outcome.[/quote]
&lt;p&gt;Can you list the configurations you did try?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>