mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-25 07:35:40 -07:00
kvv test added
This commit is contained in:
parent
8aee946895
commit
fb9d19e43a
1 changed files with 39 additions and 2 deletions
|
@ -10,7 +10,44 @@
|
||||||
|
|
||||||
#include "cipursetest.h"
|
#include "cipursetest.h"
|
||||||
|
|
||||||
bool CIPURSETest(bool verbose) {
|
#include <unistd.h>
|
||||||
|
#include <string.h> // memcpy memset
|
||||||
|
#include "fileutils.h"
|
||||||
|
|
||||||
|
#include "cipurse/cipursecrypto.h"
|
||||||
|
#include "cipurse/cipursecore.h"
|
||||||
|
|
||||||
|
uint8_t Key[] = CIPURSE_DEFAULT_KEY;
|
||||||
|
uint8_t KeyKvv[CIPURSE_KVV_LENGTH] = {0x5f, 0xd6, 0x7b, 0xcb};
|
||||||
|
|
||||||
|
static bool TestKVV(void) {
|
||||||
|
uint8_t kvv[CIPURSE_KVV_LENGTH] = {0};
|
||||||
|
CipurseCGetKVV(Key, kvv);
|
||||||
|
//PrintAndLogEx(INFO, "kvv: %s", sprint_hex(kvv, 4));
|
||||||
|
bool res = memcmp(KeyKvv, kvv, CIPURSE_KVV_LENGTH) == 0;
|
||||||
|
|
||||||
return true;
|
if (res)
|
||||||
|
PrintAndLogEx(INFO, "kvv: " _GREEN_("passed"));
|
||||||
|
else
|
||||||
|
PrintAndLogEx(INFO, "kvv: " _RED_("fail"));
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CIPURSETest(bool verbose) {
|
||||||
|
bool res = true;
|
||||||
|
|
||||||
|
PrintAndLogEx(INFO, "------ " _CYAN_("CIPURSE TESTS") " ------");
|
||||||
|
|
||||||
|
res = res && TestKVV();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PrintAndLogEx(INFO, "---------------------------");
|
||||||
|
if (res)
|
||||||
|
PrintAndLogEx(SUCCESS, "\tTest(s) [ %s ]", _GREEN_("ok"));
|
||||||
|
else
|
||||||
|
PrintAndLogEx(FAILED, "\tTest(s) [ %s ]", _RED_("fail"));
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue