SM4_BLOCK_SIZE
if (memcmp(block, input, SM4_BLOCK_SIZE) != 0) {
hexdump(stderr, "Got", block, SM4_BLOCK_SIZE);
hexdump(stderr, "Expected", input, SM4_BLOCK_SIZE);
uint8_t block[SM4_BLOCK_SIZE];
static const uint8_t k[SM4_BLOCK_SIZE] = {
static const uint8_t input[SM4_BLOCK_SIZE] = {
static const uint8_t expected[SM4_BLOCK_SIZE] = {
static const uint8_t expected_iter[SM4_BLOCK_SIZE] = {
memcpy(block, input, SM4_BLOCK_SIZE);
if (memcmp(block, expected, SM4_BLOCK_SIZE) != 0) {
hexdump(stderr, "Got", block, SM4_BLOCK_SIZE);
hexdump(stderr, "Expected", expected, SM4_BLOCK_SIZE);
if (memcmp(block, expected_iter, SM4_BLOCK_SIZE) != 0) {
hexdump(stderr, "Got", block, SM4_BLOCK_SIZE);
hexdump(stderr, "Expected", expected_iter, SM4_BLOCK_SIZE);