Browse Source

Make strip_size = error - 1.

Michele Orrù 6 years ago
parent
commit
8cf1e54f05
3 changed files with 3 additions and 3 deletions
  1. 1 1
      configure.ac
  2. 1 1
      src/ddlog.c
  3. 1 1
      src/ddlog.h

+ 1 - 1
configure.ac

@@ -55,7 +55,7 @@ AC_ARG_ENABLE(debug,
    CFLAGS+=" -DNDEBUG -O3 -march=native")
 
 
-AC_DEFINE([ERROR],  [16], [log inverse of the error probability, default: 16.])
+AC_DEFINE([ERROR],  [17], [log inverse of the error probability, default: 17.])
 AC_DEFINE([FB_BASE], [10], [log of precomputed base for group operation, default: 8.])
 AC_DEFINE([SS_BASE], [1], [log of secret shares representation, default: 1.])
 

+ 1 - 1
src/ddlog.c

@@ -45,7 +45,7 @@ uint32_t __attribute__((optimize("unroll-loops"))) convert(uint64_t * nn)
   for (uint32_t w2 = halfstrip_size; w2 < 64-halfstrip_size; w2 += halfstrip_size) {
     if (!(x & (topmask >> w2))) {
       const size_t previous = (x >> (64 - halfstrip_size - w2 + halfstrip_size)) & bottommask;
-      const uint32_t next =    (x >> (64 - halfstrip_size - w2 - halfstrip_size)) & bottommask;
+      const uint32_t next =   (x >> (64 - halfstrip_size - w2 - halfstrip_size)) & bottommask;
       if (next <= lookup[previous]) return w2 - offset[previous];
     }
   }

+ 1 - 1
src/ddlog.h

@@ -4,7 +4,7 @@
 #include <stdint.h>
 #include <gmp.h>
 
-#define strip_size (ERROR)
+#define strip_size (ERROR - 1)
 #define halfstrip_size ((strip_size)/2)
 
 extern uint32_t lookup[256];