]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
optimized loop in MifareNested (issue 36)
authordn337t@gmail.com <dn337t@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 29 May 2012 13:23:07 +0000 (13:23 +0000)
committerdn337t@gmail.com <dn337t@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 29 May 2012 13:23:07 +0000 (13:23 +0000)
armsrc/mifarecmd.c

index 4148a3c29cac13707409701e8833589d4f333335..b2b38edf91f87cf1c294c28f62507ee873059da0 100644 (file)
@@ -417,8 +417,9 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain)
                }\r
                \r
                ncount = 0;\r
-               for (m = dmin - NS_TOLERANCE; m < dmax + NS_TOLERANCE; m++) {\r
-                       nttest = prng_successor(nt1, m);\r
+               nttest = prng_successor(nt1, dmin - NS_TOLERANCE);\r
+               for (m = dmin - NS_TOLERANCE + 1; m < dmax + NS_TOLERANCE; m++) {\r
+                       nttest = prng_successor(nttest, 1);\r
                        ks1 = nt2 ^ nttest;\r
 \r
                        if (valid_nonce(nttest, nt2, ks1, par_array) && (ncount < 11)){\r
Impressum, Datenschutz