Github user tellison commented on a diff in the pull request:

    https://github.com/apache/incubator-pirk/pull/111#discussion_r84031817
  
    --- Diff: 
src/main/java/org/apache/pirk/querier/wideskies/encrypt/EncryptQuery.java ---
    @@ -178,11 +217,14 @@ public Querier encrypt(int numThreads) throws 
InterruptedException, PIRException
           {
             // Hash collision
             selectorQueryVecMapping.clear();
    -        hashKey = queryInfo.getHashKey() + ++keyCounter;
    +        hashKey = hashKeyBase + getRandByteString(10);
             logger.debug("index = " + index + "selector = " + selector + " 
hash collision = " + hash + " new key = " + hashKey);
             index = -1;
           }
         }
    +    
    +    // Save off the final hashKey that we ended up using
    +    queryInfo.setHashKey(hashKey);
    --- End diff --
    
    I think this should be a separate field in ```Query```, e.g. 
```setEncryptionHashKey()```.  At present, I can repeatedly create 
```EncryptQuery(QueryInfo, List<String>, Paillier)```, and it is 
non-destructive on the ```Query```, just recalculating the expTable etc.
    
    However, with this change the hashKey is overwritten, and extended on each 
encryption of the query info, so repeated calls cause longer and longer hash 
keys.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to