X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/ab8b654efa9524b494014efd35ac426aaa42884b..9fc6a167792c48d20a41bc716d85a2e2b0a22b0b:/armsrc/mifarecmd.c

diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c
index d2795b1a..b2b38edf 100644
--- a/armsrc/mifarecmd.c
+++ b/armsrc/mifarecmd.c
@@ -298,7 +298,7 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain)
 	uint8_t uid[8];
 	uint32_t cuid, nt1, nt2, nttmp, nttest, par, ks1;
 	uint8_t par_array[4];
-	nestedVector nvector[NES_MAX_INFO + 1][10];
+	nestedVector nvector[NES_MAX_INFO + 1][11];
 	int nvectorcount[NES_MAX_INFO + 1];
 	int ncount = 0;
 	UsbCommand ack = {CMD_ACK, {0, 0, 0}};
@@ -417,8 +417,9 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain)
 		}
 		
 		ncount = 0;
-		for (m = dmin - NS_TOLERANCE; m < dmax + NS_TOLERANCE; m++) {
-			nttest = prng_successor(nt1, m);
+		nttest = prng_successor(nt1, dmin - NS_TOLERANCE);
+		for (m = dmin - NS_TOLERANCE + 1; m < dmax + NS_TOLERANCE; m++) {
+			nttest = prng_successor(nttest, 1);
 			ks1 = nt2 ^ nttest;
 
 			if (valid_nonce(nttest, nt2, ks1, par_array) && (ncount < 11)){