Quellcode durchsuchen

Have RDPF::expand() use descend_to_leaf for the last layer

Ian Goldberg vor 1 Jahr
Ursprung
Commit
6569a4f55d
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      rdpf.tcc

+ 4 - 4
rdpf.tcc

@@ -764,8 +764,8 @@ void RDPF<WIDTH>::expand(size_t &aes_ops)
     for (nbits_t i=1;i<depth;++i) {
         path[i] = descend(path[i-1], i-1, 0, aes_ops);
     }
-    expansion[index++][0] = descend(path[depth-1], depth-1, 0, aes_ops);
-    expansion[index++][0] = descend(path[depth-1], depth-1, 1, aes_ops);
+    expansion[index++] = descend_to_leaf(path[depth-1], depth-1, 0, aes_ops);
+    expansion[index++] = descend_to_leaf(path[depth-1], depth-1, 1, aes_ops);
     while(index < num_leaves) {
         // Invariant: lastindex and index will both be even, and
         // index=lastindex+2
@@ -785,8 +785,8 @@ void RDPF<WIDTH>::expand(size_t &aes_ops)
             path[i+1] = descend(path[i], i, 0, aes_ops);
         }
         lastindex = index;
-        expansion[index++][0] = descend(path[depth-1], depth-1, 0, aes_ops);
-        expansion[index++][0] = descend(path[depth-1], depth-1, 1, aes_ops);
+        expansion[index++] = descend_to_leaf(path[depth-1], depth-1, 0, aes_ops);
+        expansion[index++] = descend_to_leaf(path[depth-1], depth-1, 1, aes_ops);
     }
 
     delete[] path;