<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HSE AES182 encryption not working correctly in S32K</title>
    <link>https://community.nxp.com/t5/S32K/HSE-AES182-encryption-not-working-correctly/m-p/2092018#M48468</link>
    <description>That solved the problem.&lt;BR /&gt;Thank you!</description>
    <pubDate>Tue, 06 May 2025 08:36:51 GMT</pubDate>
    <dc:creator>Rmpr</dc:creator>
    <dc:date>2025-05-06T08:36:51Z</dc:date>
    <item>
      <title>HSE AES182 encryption not working correctly</title>
      <link>https://community.nxp.com/t5/S32K/HSE-AES182-encryption-not-working-correctly/m-p/2091443#M48439</link>
      <description>&lt;P&gt;Hello, I'm trying to encrypt an array of 16 of a plain text:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint8 Data_au8[AES128_ECB_PLAIN_TEXT_SIZE] = {
    0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the array initialized like this, this works fine since it gives the the following encrypted array:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rmpr_0-1746450034995.png" style="width: 707px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336186iD90A381822BF5C1E/image-dimensions/707x15?v=v2" width="707" height="15" role="button" title="Rmpr_0-1746450034995.png" alt="Rmpr_0-1746450034995.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, this is not what I want my code to do, I want to change the values of the array in my main function, but If I do this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint8 Status_u8 = 0x01u;

uint8 Data_au8[AES128_ECB_PLAIN_TEXT_SIZE] = {
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};

int main()
{
    Data_au8[0] = Status_u8;
    Data_au8[1] = Status_u8;

    /* Encryption */
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't encrypt properly:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rmpr_1-1746450566196.png" style="width: 676px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336192i51896D1ED3D326F7/image-dimensions/676x43?v=v2" width="676" height="43" role="button" title="Rmpr_1-1746450566196.png" alt="Rmpr_1-1746450566196.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be causing this?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 13:10:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-AES182-encryption-not-working-correctly/m-p/2091443#M48439</guid>
      <dc:creator>Rmpr</dc:creator>
      <dc:date>2025-05-05T13:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: HSE AES182 encryption not working correctly</title>
      <link>https://community.nxp.com/t5/S32K/HSE-AES182-encryption-not-working-correctly/m-p/2091975#M48465</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/220829"&gt;@Rmpr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sounds like data cache issue. All the data objects used for communication with HSE must be forced to non-cacheable memory. The data cache is usually configured to copy-back mode and HSE can't see the data cache on core(s), so this may cause coherency issues. HSE always accesses physical addresses only. &lt;/P&gt;
&lt;P&gt;For quick test, you can try to disable the data cache completely. Either in your project settings or in your debugger:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_0-1746517563666.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336319i3136D7D7A59CCB1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_0-1746517563666.png" alt="lukaszadrapa_0-1746517563666.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_1-1746517680478.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/336320iD7170A80A4A40E63/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_1-1746517680478.png" alt="lukaszadrapa_1-1746517680478.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 07:48:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-AES182-encryption-not-working-correctly/m-p/2091975#M48465</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2025-05-06T07:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: HSE AES182 encryption not working correctly</title>
      <link>https://community.nxp.com/t5/S32K/HSE-AES182-encryption-not-working-correctly/m-p/2092018#M48468</link>
      <description>That solved the problem.&lt;BR /&gt;Thank you!</description>
      <pubDate>Tue, 06 May 2025 08:36:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-AES182-encryption-not-working-correctly/m-p/2092018#M48468</guid>
      <dc:creator>Rmpr</dc:creator>
      <dc:date>2025-05-06T08:36:51Z</dc:date>
    </item>
  </channel>
</rss>

