Module sha256_test

Source
Expand description

This tests a software SHA256 implementation. To run this test, add this line to the imix boot sequence:

    test::sha256_test::run_sha256();

This test uses a deferred call (for callbacks). It tries to hash ‘hello world’ and uses Digest::validate to check that the hash is correct.

The expected output is Sha256Test: Verification result: Ok(true)

This tests whether the SHA-256 hash of the string “hello hello hello hello hello hello hello hello hello hello hello hello “ hashes correctly. This string is 12 repetitions of “hello “, so is 72 bytes long. As SHA uses 64-byte/512 bit blocks, this verifies that multi-block hashes work correctly.

Statics§

HHASH
HSTRING
LHASH
LSTRING

Functions§

run_sha256
static_init_test_sha256 🔒