iPXE
|
Go to the source code of this file.
Data Structures | |
struct | digest_test |
A digest test. More... | |
Macros | |
#define | DATA(...) { __VA_ARGS__ } |
Define inline test data. More... | |
#define | DIGEST(...) { __VA_ARGS__ } |
Define inline expected digest value. More... | |
#define | DIGEST_TEST(name, DIGEST, DATA, EXPECTED) |
Define a digest test. More... | |
#define | DIGEST_EMPTY DATA() |
Standard test vector: empty data. More... | |
#define | DIGEST_NIST_ABC DATA ( 0x61, 0x62, 0x63 ) |
Standard test vector: NIST string "abc". More... | |
#define | DIGEST_NIST_ABC_OPQ |
Standard test vector: NIST string "abc...opq". More... | |
#define | DIGEST_NIST_ABC_STU |
Standard test vector: NIST string "abc...stu". More... | |
#define | digest_ok(test) digest_okx ( test, __FILE__, __LINE__ ) |
Report a digest test result. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | digest_okx (struct digest_test *test, const char *file, unsigned int line) |
Report a digest test result. More... | |
unsigned long | digest_cost (struct digest_algorithm *digest) |
Calculate digest algorithm cost. More... | |
#define DATA | ( | ... | ) | { __VA_ARGS__ } |
Define inline test data.
Definition at line 25 of file digest_test.h.
#define DIGEST | ( | ... | ) | { __VA_ARGS__ } |
Define inline expected digest value.
Definition at line 28 of file digest_test.h.
Define a digest test.
name | Test name |
DIGEST | Digest algorithm |
DATA | Test data |
EXPECTED | Expected digest value |
test | Digest test |
Definition at line 39 of file digest_test.h.
#define DIGEST_EMPTY DATA() |
Standard test vector: empty data.
Definition at line 51 of file digest_test.h.
#define DIGEST_NIST_ABC DATA ( 0x61, 0x62, 0x63 ) |
Standard test vector: NIST string "abc".
The NIST Cryptographic Toolkit examples for all digest algorithms include a test vector which is the unterminated string
"abc"
Definition at line 60 of file digest_test.h.
#define DIGEST_NIST_ABC_OPQ |
Standard test vector: NIST string "abc...opq".
The NIST Cryptographic Toolkit examples for all 32-bit digest algorithms (SHA-1 and the SHA-256 family) include a test vector which is the unterminated string
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
Definition at line 71 of file digest_test.h.
#define DIGEST_NIST_ABC_STU |
Standard test vector: NIST string "abc...stu".
The NIST Cryptographic Toolkit examples for all 64-bit digest algorithms (SHA-512 family) include a test vector which is the unterminated string
"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
Definition at line 89 of file digest_test.h.
#define digest_ok | ( | test | ) | digest_okx ( test, __FILE__, __LINE__ ) |
Report a digest test result.
test | Digest test |
Definition at line 109 of file digest_test.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void digest_okx | ( | struct digest_test * | test, |
const char * | file, | ||
unsigned int | line | ||
) |
Report a digest test result.
test | Digest test |
file | Test code file |
line | Test code line |
Definition at line 111 of file digest_test.c.
References digest_frag_okx(), digest_test_fragments, NULL, and test.
unsigned long digest_cost | ( | struct digest_algorithm * | digest | ) |
Calculate digest algorithm cost.
digest | Digest algorithm |
cost | Cost (in cycles per byte) |
Definition at line 131 of file digest_test.c.
References cost, ctx, digest_algorithm::ctxsize, digest_final(), digest_init(), digest_update(), digest_algorithm::digestsize, memset(), out, PROFILE_COUNT, profile_mean(), profile_start(), profile_stop(), rand(), random(), and srand().
Referenced by md4_test_exec(), md5_test_exec(), sha1_test_exec(), sha256_test_exec(), and sha512_test_exec().