mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-23 19:33:09 +00:00
style
This commit is contained in:
1 parent
2630310336
commit
2e2598bca9
43 files changed
+462
-444
No files matched your search
+2
-2
@@ -63,8 +63,8 @@ typedef struct {
|
||||
uint64_t current_key; // Use 64 bit and truncate when needed.
|
||||
uint8_t mode;
|
||||
uint8_t charset[
|
||||
BF_CHARSET_DIGITS_SIZE
|
||||
+ BF_CHARSET_UPPERCASE_SIZE
|
||||
BF_CHARSET_DIGITS_SIZE
|
||||
+ BF_CHARSET_UPPERCASE_SIZE
|
||||
];
|
||||
uint8_t charset_length;
|
||||
|
||||
|
||||
+12
-12
@@ -73,14 +73,14 @@
|
||||
|
||||
static const int Iso15693FrameSOF[] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
-1, -1, -1, -1,
|
||||
-1, -1, -1, -1,
|
||||
1, 1, 1, 1,
|
||||
1, 1, 1, 1
|
||||
};
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
-1, -1, -1, -1,
|
||||
-1, -1, -1, -1,
|
||||
1, 1, 1, 1,
|
||||
1, 1, 1, 1
|
||||
};
|
||||
static const int Iso15693Logic0[] = {
|
||||
1, 1, 1, 1,
|
||||
1, 1, 1, 1,
|
||||
@@ -89,10 +89,10 @@ static const int Iso15693Logic0[] = {
|
||||
};
|
||||
static const int Iso15693Logic1[] = {
|
||||
-1, -1, -1, -1,
|
||||
-1, -1, -1, -1,
|
||||
1, 1, 1, 1,
|
||||
1, 1, 1, 1
|
||||
};
|
||||
-1, -1, -1, -1,
|
||||
1, 1, 1, 1,
|
||||
1, 1, 1, 1
|
||||
};
|
||||
|
||||
// EOF defined as
|
||||
// 1) logic '0' (8 pulses of 423.75kHz followed by unmodulated for 18.88us)
|
||||
|
||||
+13
-13
@@ -254,7 +254,7 @@ void mbedtls_aesni_inverse_key(unsigned char *invkey,
|
||||
for (fk -= 16, ik += 16; fk > fwdkey; fk -= 16, ik += 16)
|
||||
asm("movdqu (%0), %%xmm0 \n\t"
|
||||
AESIMC xmm0_xmm0 "\n\t"
|
||||
"movdqu %%xmm0, (%1) \n\t"
|
||||
"movdqu %%xmm0, (%1) \n\t"
|
||||
:
|
||||
: "r"(fk), "r"(ik)
|
||||
: "memory", "xmm0");
|
||||
@@ -403,23 +403,23 @@ static void aesni_setkey_enc_256(unsigned char *rk,
|
||||
/* Set xmm2 to stuff:Y:stuff:stuff with Y = subword( r11 )
|
||||
* and proceed to generate next round key from there */
|
||||
AESKEYGENA xmm0_xmm2 ",0x00 \n\t"
|
||||
"pshufd $0xaa, %%xmm2, %%xmm2 \n\t"
|
||||
"pxor %%xmm1, %%xmm2 \n\t"
|
||||
"pslldq $4, %%xmm1 \n\t"
|
||||
"pxor %%xmm1, %%xmm2 \n\t"
|
||||
"pslldq $4, %%xmm1 \n\t"
|
||||
"pxor %%xmm1, %%xmm2 \n\t"
|
||||
"pslldq $4, %%xmm1 \n\t"
|
||||
"pxor %%xmm2, %%xmm1 \n\t"
|
||||
"add $16, %0 \n\t"
|
||||
"movdqu %%xmm1, (%0) \n\t"
|
||||
"ret \n\t"
|
||||
"pshufd $0xaa, %%xmm2, %%xmm2 \n\t"
|
||||
"pxor %%xmm1, %%xmm2 \n\t"
|
||||
"pslldq $4, %%xmm1 \n\t"
|
||||
"pxor %%xmm1, %%xmm2 \n\t"
|
||||
"pslldq $4, %%xmm1 \n\t"
|
||||
"pxor %%xmm1, %%xmm2 \n\t"
|
||||
"pslldq $4, %%xmm1 \n\t"
|
||||
"pxor %%xmm2, %%xmm1 \n\t"
|
||||
"add $16, %0 \n\t"
|
||||
"movdqu %%xmm1, (%0) \n\t"
|
||||
"ret \n\t"
|
||||
|
||||
/*
|
||||
* Main "loop" - Generating one more key than necessary,
|
||||
* see definition of mbedtls_aes_context.buf
|
||||
*/
|
||||
"2: \n\t"
|
||||
"2: \n\t"
|
||||
AESKEYGENA xmm1_xmm2 ",0x01 \n\tcall 1b \n\t"
|
||||
AESKEYGENA xmm1_xmm2 ",0x02 \n\tcall 1b \n\t"
|
||||
AESKEYGENA xmm1_xmm2 ",0x04 \n\tcall 1b \n\t"
|
||||
|
||||
@@ -215,16 +215,16 @@ static const signed char indexes[2][4][20] = {
|
||||
}, /* KL -> RK */
|
||||
{
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1
|
||||
}, /* KR -> RK */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1
|
||||
}, /* KR -> RK */
|
||||
{
|
||||
4, 5, 6, 7, 12, 13, 14, 15, 16, 17,
|
||||
18, 19, -1, 24, 25, -1, 31, 28, 29, 30
|
||||
}, /* KA -> RK */
|
||||
{
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1
|
||||
} /* KB -> RK */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1
|
||||
} /* KB -> RK */
|
||||
},
|
||||
{
|
||||
{
|
||||
@@ -233,12 +233,12 @@ static const signed char indexes[2][4][20] = {
|
||||
}, /* KL -> RK */
|
||||
{
|
||||
-1, -1, -1, -1, 8, 9, 10, 11, 16, 17,
|
||||
18, 19, -1, -1, -1, -1, 39, 36, 37, 38
|
||||
}, /* KR -> RK */
|
||||
18, 19, -1, -1, -1, -1, 39, 36, 37, 38
|
||||
}, /* KR -> RK */
|
||||
{
|
||||
-1, -1, -1, -1, 12, 13, 14, 15, 58, 59,
|
||||
56, 57, 31, 28, 29, 30, -1, -1, -1, -1
|
||||
}, /* KA -> RK */
|
||||
56, 57, 31, 28, 29, 30, -1, -1, -1, -1
|
||||
}, /* KA -> RK */
|
||||
{
|
||||
4, 5, 6, 7, 65, 66, 67, 64, 20, 21,
|
||||
22, 23, -1, -1, -1, -1, 43, 40, 41, 42
|
||||
|
||||
@@ -119,7 +119,7 @@ void mbedtls_ctr_drbg_set_reseed_interval(mbedtls_ctr_drbg_context *ctx,
|
||||
static int block_cipher_df(unsigned char *output,
|
||||
const unsigned char *data, size_t data_len) {
|
||||
unsigned char buf[MBEDTLS_CTR_DRBG_MAX_SEED_INPUT +
|
||||
MBEDTLS_CTR_DRBG_BLOCKSIZE + 16];
|
||||
MBEDTLS_CTR_DRBG_BLOCKSIZE + 16];
|
||||
unsigned char tmp[MBEDTLS_CTR_DRBG_SEEDLEN];
|
||||
unsigned char key[MBEDTLS_CTR_DRBG_KEYSIZE];
|
||||
unsigned char chain[MBEDTLS_CTR_DRBG_BLOCKSIZE];
|
||||
|
||||
@@ -86,7 +86,7 @@ static void debug_header(memory_header *hdr) {
|
||||
#endif
|
||||
|
||||
mbedtls_fprintf(stderr, "HDR: PTR(%10zu), PREV(%10zu), NEXT(%10zu), "
|
||||
"ALLOC(%zu), SIZE(%10zu)\n",
|
||||
"ALLOC(%zu), SIZE(%10zu)\n",
|
||||
(size_t) hdr, (size_t) hdr->prev, (size_t) hdr->next,
|
||||
hdr->alloc, hdr->size);
|
||||
mbedtls_fprintf(stderr, " FPREV(%10zu), FNEXT(%10zu)\n",
|
||||
@@ -164,7 +164,7 @@ static int verify_chain(void) {
|
||||
if (prv == NULL || verify_header(prv) != 0) {
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf(stderr, "FATAL: verification of first header "
|
||||
"failed\n");
|
||||
"failed\n");
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
@@ -172,7 +172,7 @@ static int verify_chain(void) {
|
||||
if (heap.first->prev != NULL) {
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf(stderr, "FATAL: verification failed: "
|
||||
"first->prev != NULL\n");
|
||||
"first->prev != NULL\n");
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
@@ -183,7 +183,7 @@ static int verify_chain(void) {
|
||||
if (verify_header(cur) != 0) {
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf(stderr, "FATAL: verification of header "
|
||||
"failed\n");
|
||||
"failed\n");
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ static int verify_chain(void) {
|
||||
if (cur->prev != prv) {
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf(stderr, "FATAL: verification failed: "
|
||||
"cur->prev != prv\n");
|
||||
"cur->prev != prv\n");
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ static void *buffer_alloc_calloc(size_t n, size_t size) {
|
||||
if (cur->alloc != 0) {
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf(stderr, "FATAL: block in free_list but allocated "
|
||||
"data\n");
|
||||
"data\n");
|
||||
#endif
|
||||
mbedtls_exit(1);
|
||||
}
|
||||
@@ -359,7 +359,7 @@ static void buffer_alloc_free(void *ptr) {
|
||||
if (p < heap.buf || p >= heap.buf + heap.len) {
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf(stderr, "FATAL: mbedtls_free() outside of managed "
|
||||
"space\n");
|
||||
"space\n");
|
||||
#endif
|
||||
mbedtls_exit(1);
|
||||
}
|
||||
@@ -373,7 +373,7 @@ static void buffer_alloc_free(void *ptr) {
|
||||
if (hdr->alloc != 1) {
|
||||
#if defined(MBEDTLS_MEMORY_DEBUG)
|
||||
mbedtls_fprintf(stderr, "FATAL: mbedtls_free() on unallocated "
|
||||
"data\n");
|
||||
"data\n");
|
||||
#endif
|
||||
mbedtls_exit(1);
|
||||
}
|
||||
|
||||
@@ -445,14 +445,14 @@ union mbedtls_ssl_premaster_secret {
|
||||
#endif
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
|
||||
unsigned char _pms_dhe_psk[4 + MBEDTLS_MPI_MAX_SIZE
|
||||
+ MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 3 */
|
||||
+ MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 3 */
|
||||
#endif
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
|
||||
unsigned char _pms_rsa_psk[52 + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 4 */
|
||||
#endif
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
|
||||
unsigned char _pms_ecdhe_psk[4 + MBEDTLS_ECP_MAX_BYTES
|
||||
+ MBEDTLS_PSK_MAX_LEN]; /* RFC 5489 2 */
|
||||
+ MBEDTLS_PSK_MAX_LEN]; /* RFC 5489 2 */
|
||||
#endif
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
|
||||
unsigned char _pms_ecjpake[32]; /* Thread spec: SHA-256 output */
|
||||
|
||||
@@ -804,7 +804,7 @@ static int ssl_write_use_srtp_ext(mbedtls_ssl_context *ssl,
|
||||
*/
|
||||
MBEDTLS_SSL_DEBUG_MSG(3,
|
||||
("client hello, "
|
||||
"illegal DTLS-SRTP protection profile %d",
|
||||
"illegal DTLS-SRTP protection profile %d",
|
||||
ssl->conf->dtls_srtp_profile_list[protection_profiles_index]
|
||||
));
|
||||
return (MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED);
|
||||
|
||||
@@ -3954,7 +3954,7 @@ static int ssl_buffer_message(mbedtls_ssl_context *ssl) {
|
||||
/* Silently ignore -- message too far in the future */
|
||||
MBEDTLS_SSL_DEBUG_MSG(2,
|
||||
("Ignore future HS message with sequence number %u, "
|
||||
"buffering window %u - %u",
|
||||
"buffering window %u - %u",
|
||||
recv_msg_seq, ssl->handshake->in_msg_seq,
|
||||
ssl->handshake->in_msg_seq + MBEDTLS_SSL_MAX_BUFFERED_HS - 1));
|
||||
|
||||
|
||||
@@ -2101,7 +2101,7 @@ int mbedtls_x509_crt_verify_info(char *buf, size_t size, const char *prefix,
|
||||
|
||||
if (flags != 0) {
|
||||
ret = mbedtls_snprintf(p, n, "%sUnknown reason "
|
||||
"(this should not happen)\n", prefix);
|
||||
"(this should not happen)\n", prefix);
|
||||
MBEDTLS_X509_SAFE_SNPRINTF;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user