<p>The MCUXpresso SDK provides a peripheral driver for the Hashcrypt peripheral. The Hashcrypt peripheral provides one or more engines to perform specific symmetric crypto algorithms, including hashing and en/decryption. The cryptographic acceleration is normally used in conjunction with pure-hardware blocks for hashing and symmetric cryptography, thereby providing performance and energy efficiency for a range of cryptographic uses.</p>
<p>Blocking synchronous APIs are provided for selected cryptographic algorithms using Hashcrypt hardware. The driver interface intends to be easily integrated with generic software crypto libraries such as mbedTLS. The Hashcrypt operations are complete (and results are made availabe for further usage) when a function returns. When called, these functions do not return until an Hashcrypt operation is complete. These functions use main CPU for simple polling loops to determine operation complete or error status and also for plaintext or ciphertext data movements. These functions provide typical interface to upper layer or application software. There is one non-blocking function provided for the purpose of background hashing. <aclass="el"href="a00255.html#ga19c0131424db9a618d164fdb6ffa470e"title="Create running hash on given data. ">HASHCRYPT_SHA_UpdateNonBlocking()</a> starts hashing of an input message while the CPU can continue executing.</p>
<h1><aclass="anchor"id="HASHCRYPTInit"></a>
Hashcrypt Driver Initialization and deinitialization</h1>
<p>Hashcrypt Driver is initialized by calling the <aclass="el"href="a00256.html#ga02f8a8a22a0ac96e7ac823da4cacd585"title="Enables clock and disables reset for HASHCRYPT peripheral. ">HASHCRYPT_Init()</a> function, it enables clock and disables reset for Hashcrypt peripheral. Hashcrypt Driver is deinitialized by calling the <aclass="el"href="a00256.html#ga2561c8bc17a4b2143a0cc7c46de64fbe"title="Disables clock for HASHCRYPT peripheral. ">HASHCRYPT_Deinit()</a> function, it sisables clock and enables reset.</p>
<h1><aclass="anchor"id="HASHCRYPTRtos"></a>
Comments about API usage in RTOS</h1>
<p>Hashcrypt operations provided by this driver are not re-entrant. Thus, application software shall ensure the Hashcrypt module operation is not requested from different tasks or interrupt service routines while an operation is in progress.</p>
<h1><aclass="anchor"id="HASHCRYPTIsr"></a>
Comments about API usage in interrupt handler</h1>
<p>APIs can be used from interrupt handler although execution time shall be considered (interrupt latency increases considerably).</p>
<h1><aclass="anchor"id="HASHCRYPTx"></a>
Hashcrypt Driver Examples</h1>
<h2><aclass="anchor"id="HASHCRYPTSimpleEx"></a>
Simple examples</h2>
<p>Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/hashcrypt/ </p>
<trclass="memitem:a00256"><tdclass="memItemLeft"align="right"valign="top"> </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="a00256.html">Hashcrypt common functions</a></td></tr>