libfreefare/test/test_mifare_classic_create_trailer_block.c

18 lines
513 B
C
Raw Normal View History

2010-01-11 21:14:30 +01:00
#include <cutter.h>
#include <freefare.h>
void
2017-06-27 13:58:31 +02:00
test_mifare_classic_create_trailer_block(void)
2010-01-11 21:14:30 +01:00
{
MifareClassicBlock data;
MifareClassicKey key_a = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
MifareClassicKey key_b = { 0xde, 0xad, 0xbe, 0xef, 0xff, 0xff };
2017-06-27 13:58:31 +02:00
mifare_classic_trailer_block(&data, key_a, 0, 0, 0, 4, 0x42, key_b);
2010-01-11 21:14:30 +01:00
2017-06-27 13:58:31 +02:00
cut_assert_equal_memory(data, sizeof(data), "\xff\xff\xff\xff\xff\xff\xff\x07\x80\x42\xde\xad\xbe\xef\xff\xff", sizeof(data), cut_message("Wrong generated block"));
2010-01-11 21:14:30 +01:00
}