make style

This commit is contained in:
merlokk 2021-06-03 19:13:11 +03:00
commit f3f3a5a270
5 changed files with 169 additions and 164 deletions

View file

@ -27,16 +27,21 @@ uint8_t QConstant[CIPURSE_AES_KEY_LENGTH] = {0x74, 0x74, 0x74, 0x74, 0x74, 0x74,
uint8_t CipurseCSecurityLevelEnc(CipurseChannelSecurityLevel lvl) { uint8_t CipurseCSecurityLevelEnc(CipurseChannelSecurityLevel lvl) {
switch (lvl) { switch (lvl) {
case CPSNone: return 0x00; case CPSNone:
case CPSPlain: return 0x00; return 0x00;
case CPSMACed: return 0x01; case CPSPlain:
case CPSEncrypted: return 0x02; return 0x00;
default: return 0x00; case CPSMACed:
return 0x01;
case CPSEncrypted:
return 0x02;
default:
return 0x00;
} }
} }
static void bin_xor(uint8_t *d1, uint8_t *d2, size_t len) { static void bin_xor(uint8_t *d1, uint8_t *d2, size_t len) {
for(size_t i = 0; i < len; i++) for (size_t i = 0; i < len; i++)
d1[i] = d1[i] ^ d2[i]; d1[i] = d1[i] ^ d2[i];
} }
@ -231,7 +236,7 @@ size_t FindISO9797M2PaddingDataLen(uint8_t *data, size_t datalen) {
return 0; return 0;
} }
static uint16_t CipurseCComputeMICCRC (uint8_t *data, size_t len) { static uint16_t CipurseCComputeMICCRC(uint8_t *data, size_t len) {
uint16_t initCRC = 0x6363; uint16_t initCRC = 0x6363;
for (size_t i = 0; i < len; i++) { for (size_t i = 0; i < len; i++) {
uint8_t ch = data[i] ^ initCRC; uint8_t ch = data[i] ^ initCRC;

View file

@ -470,7 +470,7 @@ static int CmdHFCipurseReadFileAttr(const char *Cmd) {
arg_lit0(NULL, "noauth", "read file attributes without authentication"), arg_lit0(NULL, "noauth", "read file attributes without authentication"),
arg_str0(NULL, "sreq", "<plain|mac(default)|encode>", "communication reader-PICC security level"), arg_str0(NULL, "sreq", "<plain|mac(default)|encode>", "communication reader-PICC security level"),
arg_str0(NULL, "sresp", "<plain|mac(default)|encode>", "communication PICC-reader security level"), arg_str0(NULL, "sresp", "<plain|mac(default)|encode>", "communication PICC-reader security level"),
arg_lit0(NULL, "sel-adf","show info about ADF itself"), arg_lit0(NULL, "sel-adf", "show info about ADF itself"),
arg_lit0(NULL, "sel-mf", "show info about master file"), arg_lit0(NULL, "sel-mf", "show info about master file"),
arg_param_end arg_param_end
}; };