]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/crapto1.c
ADD: @marshmellow42 fudan detection in hf mfu
[proxmark3-svn] / armsrc / crapto1.c
index 17b78e327909e3afe52fa1cdb89fecd0f06b3eae..2fdeb924241ee0ac30bd631027286c4711c25771 100644 (file)
@@ -34,6 +34,7 @@ static void __attribute__((constructor)) fill_lut()
 static void quicksort(uint32_t* const start, uint32_t* const stop)\r
 {\r
        uint32_t *it = start + 1, *rit = stop;\r
+       uint32_t tmp;\r
 \r
        if(it > rit)\r
                return;\r
@@ -43,13 +44,19 @@ static void quicksort(uint32_t* const start, uint32_t* const stop)
                        ++it;\r
                else if(*rit > *start)\r
                        --rit;\r
-               else\r
-                       *it ^= (*it ^= *rit, *rit ^= *it);\r
+               else {\r
+                       tmp = *it;\r
+                       *it = *rit;\r
+                       *rit = tmp;\r
+               }\r
 \r
        if(*rit >= *start)\r
                --rit;\r
-       if(rit != start)\r
-               *rit ^= (*rit ^= *start, *start ^= *rit);\r
+       if(rit != start) {\r
+               tmp = *rit;\r
+               *rit = *start;\r
+               *start = tmp;\r
+       }\r
 \r
        quicksort(start, rit - 1);\r
        quicksort(rit + 1, stop);\r
@@ -319,9 +326,12 @@ uint8_t lfsr_rollback_bit(struct Crypto1State *s, uint32_t in, int fb)
 {\r
        int out;\r
        uint8_t ret;\r
+       uint32_t tmp;\r
 \r
        s->odd &= 0xffffff;\r
-       s->odd ^= (s->odd ^= s->even, s->even ^= s->odd);\r
+       tmp = s->odd;\r
+       s->odd = s->even;\r
+       s->even = tmp;\r
 \r
        out = s->even & 1;\r
        out ^= LF_POLY_EVEN & (s->even >>= 1);\r
@@ -440,7 +450,7 @@ check_pfx_parity(uint32_t prefix, uint32_t rresp, uint8_t parities[8][8],
        }\r
 \r
        return sl + good;\r
-} \r
+}\r
 \r
 \r
 /** lfsr_common_prefix\r
Impressum, Datenschutz