Branch data Line data Source code
1 : : #include "sute.h"
2 : :
3 : : /**
4 : : * @brief Run every SHA-512 library test group
5 : : * @details Keeps the standalone library test output grouped by the kind of
6 : : * promise being checked: known answers first, then incremental input handling
7 : : *
8 : : * @return Return status for the whole libsha512 test group
9 : : */
10 : 1 : Return test_libsha512_all(void)
11 : : {
12 : 1 : INITTEST;
13 : :
14 : 1 : bool first_header = true;
15 : :
16 : : /* Start with public known-answer tests because they describe the basic
17 : : promise users expect from any SHA-512 implementation */
18 : 1 : HEADER("Reference Digests");
19 : 1 : TEST(test_libsha512_0001,"Known SHA-512 examples produce the published digests");
20 : :
21 : : /* Then check streaming behavior: callers may hash files in chunks and still
22 : : need the exact same digest as a one-shot hash */
23 : 1 : HEADER("Incremental Hashing");
24 : 1 : TEST(test_libsha512_0002,"Chunked input produces the same digest as one-shot input");
25 : 1 : TEST(test_libsha512_0004,"Boundary-sized messages hash consistently in one-shot and chunked modes");
26 : :
27 : : /* Finish with invalid-input behavior so API failures stay predictable and
28 : : readable */
29 : 1 : HEADER("Failure Handling");
30 : 1 : TEST(test_libsha512_0003,"Invalid SHA-512 API use returns named errors without corrupting state");
31 : :
32 : 1 : RETURN_STATUS;
33 : : }
|