<?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>Compute/Verify truncated MAC using AES-128 CMAC calculation with PSA API</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123066/compute-verify-truncated-mac-using-aes-128-cmac-calculation-with-psa-api</link><description>Hi, 
 I fiddled around with examples using the PSA API to compute a MAC by AES-128 CMAC. That worked out fine. I can import a key, use it to compute the mac over a message and verify it in my example. The MAC created is 16 bytes long. Now I looked around</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Jul 2025 13:07:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123066/compute-verify-truncated-mac-using-aes-128-cmac-calculation-with-psa-api" /><item><title>RE: Compute/Verify truncated MAC using AES-128 CMAC calculation with PSA API</title><link>https://devzone.nordicsemi.com/thread/542876?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2025 13:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75e48b2b-7fa3-44cf-95cb-c37e2d81746d</guid><dc:creator>SwRa</dc:creator><description>&lt;p&gt;No problem. I will then close the case.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Swathy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compute/Verify truncated MAC using AES-128 CMAC calculation with PSA API</title><link>https://devzone.nordicsemi.com/thread/542854?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2025 11:06:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea6e2dc4-26cf-49fb-b13c-b5acd034e62e</guid><dc:creator>GeneralPurpose</dc:creator><description>&lt;p&gt;Ahaaa! I found that but didn&amp;#39;t understand the usage of that macro at first: So I put in my algorithm and length of MAC to be and get a algorithm back:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;psa_algorithm trunc_algo = PSA_ALG_TRUNCATED_MAC(PSA_ALG_CMAC, 5u);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;With that new trunc_algo as my keys attribute I import my key and just use it for signing/verification with the new algorithm, like the original PSA_ALG_CMAC.&lt;/p&gt;
&lt;p&gt;The example I wrote works correctly with that, thanks for your help!&lt;/p&gt;
&lt;p&gt;Stephan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compute/Verify truncated MAC using AES-128 CMAC calculation with PSA API</title><link>https://devzone.nordicsemi.com/thread/542840?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2025 09:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:057fad8f-89c4-40b2-bb91-1cc9626394f6</guid><dc:creator>SwRa</dc:creator><description>&lt;p&gt;Hi Stephen,&lt;/p&gt;
&lt;p&gt;I believe you can use this:&amp;nbsp;&lt;a href="https://arm-software.github.io/psa-api/crypto/1.2/api/ops/macs.html#c.PSA_ALG_TRUNCATED_MAC"&gt;https://arm-software.github.io/psa-api/crypto/1.2/api/ops/macs.html#c.PSA_ALG_TRUNCATED_MAC&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Swathy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>