40.9. SHA256 algorithm

40.9.1. Overview

sha256_example the example project shows the implementation of sha256 algorithm. - The decryption algorithm of this project adopts NIST sha256 method to complete the module encryption and decryption test.

40.9.2. Board Setting

  • No special settings

40.9.3. Running the example

When the project runs correctly, and the serial port terminal will output the following information:

tc_start() - Performing SHA256 tests (NIST tests vectors):
SHA256 test #1:
===================================================================
PASS - test_1.
SHA256 test #2:
===================================================================
PASS - test_2.
SHA256 test #3:
===================================================================
PASS - test_3.
SHA256 test #4:
===================================================================
PASS - test_4.
SHA256 test #5:
===================================================================
PASS - test_5.
SHA256 test #6:
===================================================================
PASS - test_6.
SHA256 test #7:
===================================================================
PASS - test_7.
SHA256 test #8:
===================================================================
PASS - test_8.
SHA256 test #9:
===================================================================
PASS - test_9.
SHA256 test #10:
===================================================================
PASS - test_10.
SHA256 test #11:
===================================================================
PASS - test_11.
SHA256 test #12:
===================================================================
PASS - test_12.
SHA256 test #13:
SHA256 test #14:
===================================================================
PASS - test_14.
All SHA256 tests succeeded!
===================================================================
PASS - main.
===================================================================
PROJECT EXECUTION SUCCESSFUL

Note

test_14 will take a few minutes to run, please be patient