Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRITICAL FIX: Not all differentials can cause Diff test failures #230

Closed
wants to merge 1 commit into from

Conversation

fwojcik
Copy link
Contributor

@fwojcik fwojcik commented Aug 18, 2022

This is reported bug #199.

To see this bug in action, apply the following patch (without this fix!):

@@ -158,7 +158,7 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions )
          reps,testcount,expected);

   Hash_Seed_init (hash, g_seed);
-  for(int i = 0; i < reps; i++)
+  for(int i = 0; i < 0; i++)
   {
     if(i % (reps/10) == 0) printf(".");

@@ -173,6 +173,10 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions )

   bool result = true;

+  r.rand_p(&k1,sizeof(keytype));
+  diffs.push_back(k1);
+  diffs.push_back(k1);
+
   result &= ProcessDifferentials(diffs,reps,dumpCollisions);

   return result;

This is reported bug rurban#199:  rurban#199

To see this bug in action, apply the following patch (without this fix!):
@@ -158,7 +158,7 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions )
          reps,testcount,expected);

   Hash_Seed_init (hash, g_seed);
-  for(int i = 0; i < reps; i++)
+  for(int i = 0; i < 0; i++)
   {
     if(i % (reps/10) == 0) printf(".");

@@ -173,6 +173,10 @@ bool DiffTest ( pfHash hash, int diffbits, int reps, bool dumpCollisions )

   bool result = true;

+  r.rand_p(&k1,sizeof(keytype));
+  diffs.push_back(k1);
+  diffs.push_back(k1);
+
   result &= ProcessDifferentials(diffs,reps,dumpCollisions);

   return result;
@rurban
Copy link
Owner

rurban commented Aug 19, 2022

Already in the branch fwojcik

@rurban rurban closed this Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants