|
iPXE
|
CRC32 tests. More...
Go to the source code of this file.
Data Structures | |
| struct | crc32_test |
| A CRC32 test. More... | |
Macros | |
| #define | DATA(...) { __VA_ARGS__ } |
| Define inline data. More... | |
| #define | CRC32_TEST(name, DATA, SEED, CRC32) |
| Define a CRC32 test. More... | |
| #define | crc32_ok(test) |
| Report a CRC32 test result. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| CRC32_TEST (empty_test, DATA(), 0x12345678UL, 0x12345678UL) | |
| CRC32_TEST (hw_test, DATA( 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'), 0xffffffffUL, 0xf2b5ee7aUL) | |
| CRC32_TEST (hw_split_part1_test, DATA( 'h', 'e', 'l', 'l', 'o'), 0xffffffffUL, 0xc9ef5979UL) | |
| CRC32_TEST (hw_split_part2_test, DATA(' ', 'w', 'o', 'r', 'l', 'd'), 0xc9ef5979UL, 0xf2b5ee7aUL) | |
| static void | crc32_test_exec (void) |
| Perform CRC32 self-tests. More... | |
Variables | |
| struct self_test crc32_test | __self_test |
| CRC32 self-test. More... | |
CRC32 tests.
Test vectors generated using Perl's Digest::CRC:
use Digest::CRC qw ( crc );
printf "%#08x", crc ( $data, 32, $seed, 0, 1, 0x04c11db7, 1 );
Definition in file crc32_test.c.
| #define DATA | ( | ... | ) | { __VA_ARGS__ } |
Define inline data.
Definition at line 47 of file crc32_test.c.
Define a CRC32 test.
| name | Test name |
| DATA | Test data |
| SEED | Seed |
| CRC32 | Expected CRC32 |
| test | CRC32 test |
Definition at line 70 of file crc32_test.c.
| #define crc32_ok | ( | test | ) |
Report a CRC32 test result.
| test | CRC32 test |
Definition at line 84 of file crc32_test.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| CRC32_TEST | ( | empty_test | , |
| DATA() | , | ||
| 0x12345678UL | , | ||
| 0x12345678UL | |||
| ) |
| CRC32_TEST | ( | hw_test | , |
| DATA('h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd') | , | ||
| 0xffffffffUL | , | ||
| 0xf2b5ee7aUL | |||
| ) |
| CRC32_TEST | ( | hw_split_part2_test | , |
| DATA(' ', 'w', 'o', 'r', 'l', 'd') | , | ||
| 0xc9ef5979UL | , | ||
| 0xf2b5ee7aUL | |||
| ) |
|
static |
| struct self_test crc32_test __self_test |
CRC32 self-test.
Definition at line 117 of file crc32_test.c.
1.8.15