<?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>Is it Possible to Use Aead CCM (on a NRF 52840 with CC310) to verify a message without an encrypted Message? (Just Adata)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39258/is-it-possible-to-use-aead-ccm-on-a-nrf-52840-with-cc310-to-verify-a-message-without-an-encrypted-message-just-adata</link><description>Hi, 
 i use the Aead-Lib for CCM on the NRF52840. What is the best way to Check an Mac from a Message wich only has Adata (no acctual encryptet message)? 
 If i try to use a decrypt i get the error code for: &amp;quot;An internal error occurred when calling this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Oct 2018 06:39:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39258/is-it-possible-to-use-aead-ccm-on-a-nrf-52840-with-cc310-to-verify-a-message-without-an-encrypted-message-just-adata" /><item><title>RE: Is it Possible to Use Aead CCM (on a NRF 52840 with CC310) to verify a message without an encrypted Message? (Just Adata)</title><link>https://devzone.nordicsemi.com/thread/152784?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2018 06:39:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b78138f4-00b8-4609-90c1-68c4cd61f2e5</guid><dc:creator>DrGanmon</dc:creator><description>&lt;p&gt;Thanks. That worked Out. i had an ADATA Offset form 1 Bit &lt;span&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f644.svg" title="Rolling eyes"&gt;&amp;#x1f644;&lt;/span&gt;&lt;/span&gt;...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it Possible to Use Aead CCM (on a NRF 52840 with CC310) to verify a message without an encrypted Message? (Just Adata)</title><link>https://devzone.nordicsemi.com/thread/152072?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 13:23:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9683df46-15ff-4c7a-8991-681cf4bea4af</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Suggest that you run&amp;nbsp;nrf_crypto_aead_crypt(&amp;amp;ccm_ctx, NRF_CRYPTO_ENCRYPT,..) first, then run decrypt you dummy data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can assume that the signature is invalid if you get internal error while all parameters are otherwise correct.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it Possible to Use Aead CCM (on a NRF 52840 with CC310) to verify a message without an encrypted Message? (Just Adata)</title><link>https://devzone.nordicsemi.com/thread/152068?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 13:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aeeb9ead-2a27-4d74-a2d4-8ed27e0b1e80</guid><dc:creator>DrGanmon</dc:creator><description>&lt;p&gt;hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;as writen in the comment ALL parameters are dummys. Even the MAC.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does it mean i have no possibility to get if something with the input is wrong or the MAC was not correkt if i use the CC310?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it Possible to Use Aead CCM (on a NRF 52840 with CC310) to verify a message without an encrypted Message? (Just Adata)</title><link>https://devzone.nordicsemi.com/thread/152061?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 12:49:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c21ad3a-032c-4af4-9c96-0180b1a78738</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I noticed that you&amp;nbsp;initialize&amp;nbsp;mac to 0xFF,.., you should to use the MAC generated when you &amp;quot;encrypted&amp;quot; the data (signed in this case). Note that the cc310 backends returns internal error if the signature validation fails so it doesn&amp;#39;t necessarily mean that you passed an invalid arguments, etc.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it Possible to Use Aead CCM (on a NRF 52840 with CC310) to verify a message without an encrypted Message? (Just Adata)</title><link>https://devzone.nordicsemi.com/thread/151990?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 09:03:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05e8c51f-ed17-47e5-8825-87f7eebdfd4c</guid><dc:creator>DrGanmon</dc:creator><description>&lt;p&gt;the code i uses looks like:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t key[16] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF};
uint8_t nonce[13] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0x00, 0x00};
uint8_t mac[4] = {0xFF,0xFF, 0xFF, 0xFF}; // DEMO
uint8_t ret_buffer[20];
uint8_t auth[4] = {0xAA, 0xBB,0xCC,0xDD};
uint8_t adata[9]  = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};
ret_code_t ret;


nrf_crypto_aead_info_t const * p_ccm_info = &amp;amp;g_nrf_crypto_aes_ccm_128_info;

ret = nrf_crypto_aead_init(&amp;amp;ccm_ctx, p_ccm_info, key);
APP_ERROR_CHECK(ret);

ret = nrf_crypto_aead_crypt(&amp;amp;ccm_ctx, NRF_CRYPTO_DECRYPT, nonce, sizeof(nonce), adata, sizeof(adata), auth,0, ret_buffer, mac, sizeof(mac));

printf(nrf_crypto_error_string_get(ret));&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>