<?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: LPC55S69 AES masking countermeasure against SCA in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2343784#M59494</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229957"&gt;@Harry_Zhang&lt;/a&gt;&amp;nbsp; The problem is I am able to recover the key from the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;key code&lt;/STRONG&gt;&lt;SPAN&gt;. Or is it expected behaviour, security level?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2026 16:49:41 GMT</pubDate>
    <dc:creator>NewDwarf</dc:creator>
    <dc:date>2026-04-01T16:49:41Z</dc:date>
    <item>
      <title>LPC55S69 AES masking countermeasure against SCA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2339769#M59481</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;Whether I correctly understand that below approach should protect the reference AES-128 key against the side channel attack due to usage of the mask? I use a bit outdated API but it doesn't matter, I get the correct results.&lt;/P&gt;&lt;LI-CODE lang="c"&gt; 
    uint32_t coreClockHz = CLOCK_GetFreq(kCLOCK_CoreSysClk);

    status_t result = PUF_Init(PUF, PUF_DISCHARGE_TIME_MS, coreClockHz);
    if (result != kStatus_Success) return result;

    result = PUF_Start(PUF, ac_buffer, ac_size);
    if (result != kStatus_Success) {
        PUF_Deinit(PUF, PUF_DISCHARGE_TIME_MS, coreClockHz);
    }

    __attribute__((aligned(4)))
    uint8_t user_key[16] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c};

    __attribute__((aligned(4)))
    uint8_t keyCode[52] = {0x00};
    result =  PUF_SetUserKey(PUF, kPUF_KeyIndex_00, user_key, sizeof(user_key), keyCode, sizeof(keyCode));
    if (result != kStatus_Success) {
        PUF_Deinit(PUF, PUF_DISCHARGE_TIME_MS, coreClockHz);
    }

    hashcrypt_handle_t hch;
    hch.keySize = kHASHCRYPT_Aes128;
    hch.keyType = kHASHCRYPT_SecretKey;

    result = PUF_GetHwKey(PUF, keyCode, 52, kPUF_KeySlot0, 0x01000001);
    if (result != kStatus_Success) {
        PUF_Deinit(PUF, PUF_DISCHARGE_TIME_MS, coreClockHz);
    }

    uint8_t pt[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    uint8_t ct[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    result = HASHCRYPT_AES_EncryptEcb(HASHCRYPT, &amp;amp;hch, pt, ct, 16);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;At least key bytes at positions 0, 3, 4, 7... should be protected?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 05:30:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2339769#M59481</guid>
      <dc:creator>NewDwarf</dc:creator>
      <dc:date>2026-03-26T05:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 AES masking countermeasure against SCA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2340500#M59482</link>
      <description>&lt;P&gt;I am asking this question as I am able to recover the AES-128/AES-256 keys pushed from the PUF to the AES key register by the PUF_GetHwKey() API using the non-zero mask parameter. All key bytes are correctly recovered. Also I validated that plaintext/ciphertext is correct for the recovered AES key.&lt;/P&gt;&lt;P&gt;The question is whether I am doing something wrong with setting the mask or the mask doesn't properly work.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 16:59:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2340500#M59482</guid>
      <dc:creator>NewDwarf</dc:creator>
      <dc:date>2026-03-26T16:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 AES masking countermeasure against SCA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2341066#M59487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/261039"&gt;@NewDwarf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can check the AN12324&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN12324.pdf" target="_blank"&gt;LPC55Sxx Usage of the Physically Unclonable Function and Hash&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;• The PUF offers other features to prevent attacks. For example, by blocking functionalities (enroll, code output,&lt;BR /&gt;keylock) or by offering enhanced side-channel protection (by using a keymask)&lt;/P&gt;
&lt;P&gt;This refers only to the internal cryptographic operations during key reconstruction.&lt;/P&gt;
&lt;P&gt;The mask parameter in PUF_GetHwKey() does not protect individual AES key bytes from being observable once they are loaded into the HASHCRYPT AES key registers.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 10:18:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2341066#M59487</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2026-03-27T10:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 AES masking countermeasure against SCA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2342642#M59490</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229957"&gt;@Harry_Zhang&lt;/a&gt;&amp;nbsp;Thanks!&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The mask parameter in PUF_GetHwKey() does not protect individual AES key bytes from being observable once they are loaded into the HASHCRYPT AES key registers.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Let me clarify one more question. What is the purpose of the&amp;nbsp;"&lt;SPAN class=""&gt;&lt;STRONG&gt;keyMask&lt;/STRONG&gt;"&lt;/SPAN&gt; parameter of&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;status_t PUF_GetHwKey(&lt;/SPAN&gt;&lt;SPAN class=""&gt;PUF_Type *base, &lt;/SPAN&gt;&lt;SPAN class=""&gt;const&lt;/SPAN&gt; &lt;SPAN class=""&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN class=""&gt; *keyCode, &lt;/SPAN&gt;&lt;SPAN class=""&gt;size_t&lt;/SPAN&gt;&lt;SPAN class=""&gt; keyCodeSize, puf_key_slot_t keySlot, &lt;/SPAN&gt;&lt;SPAN class=""&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN class=""&gt; keyMask);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2026 09:03:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2342642#M59490</guid>
      <dc:creator>NewDwarf</dc:creator>
      <dc:date>2026-03-31T09:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 AES masking countermeasure against SCA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2343784#M59494</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229957"&gt;@Harry_Zhang&lt;/a&gt;&amp;nbsp; The problem is I am able to recover the key from the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;key code&lt;/STRONG&gt;&lt;SPAN&gt;. Or is it expected behaviour, security level?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2026 16:49:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2343784#M59494</guid>
      <dc:creator>NewDwarf</dc:creator>
      <dc:date>2026-04-01T16:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 AES masking countermeasure against SCA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2343960#M59495</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/261039"&gt;@NewDwarf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The keyMask parameter is used only inside the PUF hardware to add some randomness during the key‑reconstruction process.&lt;BR /&gt;Its purpose is to make the internal PUF operations slightly harder to analyze with side‑channel attacks.&lt;BR /&gt;It does NOT mask or modify the final AES key, and it does NOT protect the HASHCRYPT AES engine.&lt;BR /&gt;So the mask helps only during PUF key unwrapping, not during AES encryption.&lt;/P&gt;
&lt;P&gt;You can&amp;nbsp;view the definition of the&amp;nbsp;&lt;SPAN&gt;PUF_GetHwKey&lt;/SPAN&gt; function.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snipaste_2026-04-02_11-52-45.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/381121i079EA9381D68D607/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snipaste_2026-04-02_11-52-45.png" alt="Snipaste_2026-04-02_11-52-45.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snipaste_2026-04-02_11-54-08.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/381122iC15F3186CD83F1E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snipaste_2026-04-02_11-54-08.png" alt="Snipaste_2026-04-02_11-54-08.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2026 03:55:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2343960#M59495</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2026-04-02T03:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 AES masking countermeasure against SCA</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2343967#M59496</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/261039"&gt;@NewDwarf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, this is expected behavior.&lt;BR /&gt;The diagram shows that the PUF only protects key storage and then sends the reconstructed plaintext key directly to the AES engine.&lt;BR /&gt;The AES engine&amp;nbsp; is not side‑channel protected, so its power/EM behavior can still leak the real key during encryption.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snipaste_2026-04-02_12-11-21.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/381123iE15FB1B62AF50C72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snipaste_2026-04-02_12-11-21.png" alt="Snipaste_2026-04-02_12-11-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2026 04:12:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-AES-masking-countermeasure-against-SCA/m-p/2343967#M59496</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2026-04-02T04:12:07Z</dc:date>
    </item>
  </channel>
</rss>

