<?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 LPCxpresso55S69 TEE HASH in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCxpresso55S69-TEE-HASH/m-p/1473035#M49145</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;in a sample project (lpcxpresso55s69_hashcrypt) i saw the HASH mathod so i wanted to use this method in the LPCxpresso55S69_hello_world_s sample project:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define TEST_ASSERT(a)       \
    if (!(a))                \
    {                        \
        PRINTF("error\r\n"); \
        do                   \
        {                    \
        } while (1);         \
    }

#define CRYPTO_TEST_OUT_ARRAY_LEN 0x100
#define CRYPTO_SHA1_OUT_LEN       20
#define CRYPTO_SHA256_OUT_LEN     32
#include "fsl_hashcrypt.h"
void TestSha256(void)
{
    status_t status;
    size_t outLength;
    unsigned int length;
    unsigned char output[32];

    static const uint8_t message[] =
        "Be that word our sign of parting, bird or fiend! I shrieked upstarting"
        "Get thee back into the tempest and the Nights Plutonian shore!"
        "Leave no black plume as a token of that lie thy soul hath spoken!"
        "Leave my loneliness unbroken! quit the bust above my door!"
        "Take thy beak from out my heart, and take thy form from off my door!"
        "Quoth the raven, Nevermore.  ";

    /* Expected SHA-256 for the message. */
    static const unsigned char sha256[] = {0x63, 0x76, 0xea, 0xcc, 0xc9, 0xa2, 0xc0, 0x43, 0xf4, 0xfb, 0x01,
                                           0x34, 0x69, 0xb3, 0x0c, 0xf5, 0x28, 0x63, 0x5c, 0xfa, 0xa5, 0x65,
                                           0x60, 0xef, 0x59, 0x7b, 0xd9, 0x1c, 0xac, 0xaa, 0x31, 0xf7};

    length    = sizeof(message) - 1;
    outLength = sizeof(output);
    memset(&amp;amp;output, 0, outLength);

    /************************ SHA-256 **************************/
    status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, length, output, &amp;amp;outLength);
    TEST_ASSERT(kStatus_Success == status);
    TEST_ASSERT(outLength == 32u);
    TEST_ASSERT(memcmp(output, sha256, outLength) == 0);

    PRINTF("SHA-256 Test pass\r\n");
}

int main(void)
{
POWER_SetBodVbatLevel(kPOWER_BodVbatLevel1650mv, kPOWER_BodHystLevel50mv, false);
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);

BOARD_InitPins();
BOARD_BootClockPLL150M();
BOARD_InitDebugConsole();

HASHCRYPT_Init(HASHCRYPT);
TestSha256();
HASHCRYPT_Deinit(HASHCRYPT);

TZM_JumpToNormalWorld(NON_SECURE_START);

while (1){}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i always keep getting stuck in the loop (fsl_hashcrypt.c&amp;nbsp; &amp;nbsp;line: 706)&lt;/P&gt;&lt;PRE&gt;while (0U == (base-&amp;gt;STATUS &amp;amp; HASHCRYPT_STATUS_DIGEST_MASK))&lt;BR /&gt;{&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Could someone help me to solve this problem pls?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;THX!&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2022 17:17:35 GMT</pubDate>
    <dc:creator>Matthias344</dc:creator>
    <dc:date>2022-06-13T17:17:35Z</dc:date>
    <item>
      <title>LPCxpresso55S69 TEE HASH</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCxpresso55S69-TEE-HASH/m-p/1473035#M49145</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;in a sample project (lpcxpresso55s69_hashcrypt) i saw the HASH mathod so i wanted to use this method in the LPCxpresso55S69_hello_world_s sample project:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define TEST_ASSERT(a)       \
    if (!(a))                \
    {                        \
        PRINTF("error\r\n"); \
        do                   \
        {                    \
        } while (1);         \
    }

#define CRYPTO_TEST_OUT_ARRAY_LEN 0x100
#define CRYPTO_SHA1_OUT_LEN       20
#define CRYPTO_SHA256_OUT_LEN     32
#include "fsl_hashcrypt.h"
void TestSha256(void)
{
    status_t status;
    size_t outLength;
    unsigned int length;
    unsigned char output[32];

    static const uint8_t message[] =
        "Be that word our sign of parting, bird or fiend! I shrieked upstarting"
        "Get thee back into the tempest and the Nights Plutonian shore!"
        "Leave no black plume as a token of that lie thy soul hath spoken!"
        "Leave my loneliness unbroken! quit the bust above my door!"
        "Take thy beak from out my heart, and take thy form from off my door!"
        "Quoth the raven, Nevermore.  ";

    /* Expected SHA-256 for the message. */
    static const unsigned char sha256[] = {0x63, 0x76, 0xea, 0xcc, 0xc9, 0xa2, 0xc0, 0x43, 0xf4, 0xfb, 0x01,
                                           0x34, 0x69, 0xb3, 0x0c, 0xf5, 0x28, 0x63, 0x5c, 0xfa, 0xa5, 0x65,
                                           0x60, 0xef, 0x59, 0x7b, 0xd9, 0x1c, 0xac, 0xaa, 0x31, 0xf7};

    length    = sizeof(message) - 1;
    outLength = sizeof(output);
    memset(&amp;amp;output, 0, outLength);

    /************************ SHA-256 **************************/
    status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, length, output, &amp;amp;outLength);
    TEST_ASSERT(kStatus_Success == status);
    TEST_ASSERT(outLength == 32u);
    TEST_ASSERT(memcmp(output, sha256, outLength) == 0);

    PRINTF("SHA-256 Test pass\r\n");
}

int main(void)
{
POWER_SetBodVbatLevel(kPOWER_BodVbatLevel1650mv, kPOWER_BodHystLevel50mv, false);
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);

BOARD_InitPins();
BOARD_BootClockPLL150M();
BOARD_InitDebugConsole();

HASHCRYPT_Init(HASHCRYPT);
TestSha256();
HASHCRYPT_Deinit(HASHCRYPT);

TZM_JumpToNormalWorld(NON_SECURE_START);

while (1){}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i always keep getting stuck in the loop (fsl_hashcrypt.c&amp;nbsp; &amp;nbsp;line: 706)&lt;/P&gt;&lt;PRE&gt;while (0U == (base-&amp;gt;STATUS &amp;amp; HASHCRYPT_STATUS_DIGEST_MASK))&lt;BR /&gt;{&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Could someone help me to solve this problem pls?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;THX!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 17:17:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCxpresso55S69-TEE-HASH/m-p/1473035#M49145</guid>
      <dc:creator>Matthias344</dc:creator>
      <dc:date>2022-06-13T17:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: LPCxpresso55S69 TEE HASH</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCxpresso55S69-TEE-HASH/m-p/1473830#M49163</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I tried on my side but I do not have the same issue. Could you tell me if you have additional configuration?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pavel_Hernandez_0-1655227619749.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/183322i3092BF0579224D62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pavel_Hernandez_0-1655227619749.png" alt="Pavel_Hernandez_0-1655227619749.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_hashcrypt.h"
#include &amp;lt;string.h&amp;gt;
#include "fsl_power.h"


#define TEST_ASSERT(a)       \
    if (!(a))                \
    {                        \
        PRINTF("error\r\n"); \
        do                   \
        {                    \
        } while (1);         \
    }

#define CRYPTO_TEST_OUT_ARRAY_LEN 0x100
#define CRYPTO_SHA1_OUT_LEN       20
#define CRYPTO_SHA256_OUT_LEN     32

void TestSha256(void)
{
    status_t status;
    size_t outLength;
    unsigned int length;
    unsigned char output[32];

    static const uint8_t message[] =
        "Be that word our sign of parting, bird or fiend! I shrieked upstarting"
        "Get thee back into the tempest and the Nights Plutonian shore!"
        "Leave no black plume as a token of that lie thy soul hath spoken!"
        "Leave my loneliness unbroken! quit the bust above my door!"
        "Take thy beak from out my heart, and take thy form from off my door!"
        "Quoth the raven, Nevermore.  ";

    /* Expected SHA-256 for the message. */
    static const unsigned char sha256[] = {0x63, 0x76, 0xea, 0xcc, 0xc9, 0xa2, 0xc0, 0x43, 0xf4, 0xfb, 0x01,
                                           0x34, 0x69, 0xb3, 0x0c, 0xf5, 0x28, 0x63, 0x5c, 0xfa, 0xa5, 0x65,
                                           0x60, 0xef, 0x59, 0x7b, 0xd9, 0x1c, 0xac, 0xaa, 0x31, 0xf7};

    length    = sizeof(message) - 1;
    outLength = sizeof(output);
    memset(&amp;amp;output, 0, outLength);

    /************************ SHA-256 **************************/
    status = HASHCRYPT_SHA(HASHCRYPT, kHASHCRYPT_Sha256, message, length, output, &amp;amp;outLength);
    TEST_ASSERT(kStatus_Success == status);
    TEST_ASSERT(outLength == 32u);
    TEST_ASSERT(memcmp(output, sha256, outLength) == 0);

    PRINTF("SHA-256 Test pass\r\n");
}

int main(void)
{

    POWER_SetBodVbatLevel(kPOWER_BodVbatLevel1650mv, kPOWER_BodHystLevel50mv, false);
    CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);

    BOARD_InitBootPins();
    BOARD_BootClockPLL150M();
    BOARD_InitDebugConsole();

    HASHCRYPT_Init(HASHCRYPT);
    TestSha256();
    HASHCRYPT_Deinit(HASHCRYPT);

    while (1)
    {
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 17:53:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCxpresso55S69-TEE-HASH/m-p/1473830#M49163</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2022-06-14T17:53:23Z</dc:date>
    </item>
  </channel>
</rss>

