chore: Apply code formatting on entire codebase for consistent style

This commit is contained in:
icex2
2023-04-06 15:39:53 +02:00
committed by icex2
parent a1a849aef3
commit 031836ef0e
186 changed files with 2446 additions and 1979 deletions
+10 -8
View File
@@ -41,28 +41,28 @@ security_id_checksum_calc(uint8_t initseed, const uint8_t *inbuf, size_t length)
v7 = 0;
do {
v8 = (result ^ (uint8_t)(v6 >> v7)) & 1;
v8 = (result ^ (uint8_t) (v6 >> v7)) & 1;
v9 = result >> 1;
if (v8) {
v9 ^= 0x8Cu;
}
v10 = (v9 ^ (uint8_t)(v6 >> (v7 + 1))) & 1;
v10 = (v9 ^ (uint8_t) (v6 >> (v7 + 1))) & 1;
v11 = v9 >> 1;
if (v10) {
v11 ^= 0x8Cu;
}
v12 = (v11 ^ (uint8_t)(v6 >> (v7 + 2))) & 1;
v12 = (v11 ^ (uint8_t) (v6 >> (v7 + 2))) & 1;
v13 = v11 >> 1;
if (v12) {
v13 ^= 0x8Cu;
}
v14 = (v13 ^ (uint8_t)(v6 >> (v7 + 3))) & 1;
v14 = (v13 ^ (uint8_t) (v6 >> (v7 + 3))) & 1;
result = v13 >> 1;
if (v14) {
@@ -137,16 +137,18 @@ bool security_id_verify(const struct security_id *id)
{
log_assert(id);
if(id->header != SECURITY_ID_HEADER) {
log_warning("PCBID header needs to be %02X but was %02X",
SECURITY_ID_HEADER, id->header);
if (id->header != SECURITY_ID_HEADER) {
log_warning(
"PCBID header needs to be %02X but was %02X",
SECURITY_ID_HEADER,
id->header);
return false;
}
uint8_t check = id->checksum;
uint8_t need = security_id_checksum_buffer(id->id);
if(check != need) {
if (check != need) {
log_warning("PCBID checksum should be %02X got %02X", need, check);
return false;
}
+18 -17
View File
@@ -1,28 +1,29 @@
#include <string.h>
#include "security/rp2.h"
#include "security/rp-util.h"
#include "security/rp2.h"
#include "security/util.h"
#include "util/crypto.h"
#include "util/log.h"
static uint8_t security_rp2_signature_scramble_table[16] = {0x0C,
0x02,
0x0F,
0x01,
0x07,
0x09,
0x04,
0x0A,
0x00,
0x0E,
0x03,
0x0D,
0x0B,
0x05,
0x08,
0x06};
static uint8_t security_rp2_signature_scramble_table[16] = {
0x0C,
0x02,
0x0F,
0x01,
0x07,
0x09,
0x04,
0x0A,
0x00,
0x0E,
0x03,
0x0D,
0x0B,
0x05,
0x08,
0x06};
void security_rp2_create_signature(
const uint8_t *plug_id_enc, const uint8_t *sign_key_packed, uint8_t *out)
+1 -1
View File
@@ -1,8 +1,8 @@
#include <string.h>
#include "security/rp-util.h"
#include "security/rp2.h"
#include "security/rp3.h"
#include "security/rp-util.h"
#include "security/util.h"
#include "util/crc.h"