eclipse-cognicrypt / CogniCrypt

CogniCrypt is an Eclipse plugin that supports Java developers in using Java Cryptographic APIs.
Eclipse Public License 2.0
61 stars 23 forks source link

Secure multiparty computation - import missing in generated output. #130

Closed rajiv-thorat closed 6 years ago

rajiv-thorat commented 6 years ago

Prerequisitives

Issue description

The imports on the generated code are not complete in the "Output.java" file.

On a fresh project select the task "Secure Multi Party Computation". Select "Server Side" Enter the server ip address and port number Select "Euclidean Distance " Select the highest security preference And finish.

kruegers commented 6 years ago

CogniCrypt calls Echlipse's "Organize imports" feature (Right-Click-> Source-> Organize Imports or Ctrl+Shift+O). Apparently, it's this feature's fault, the import is not added since when you trigger the feature manually in the file, the import is not being added either. However, if you select the quickfix to add the missing import, Eclipse does add it. My best guess is that this is related to the underscore in either the package name ABY_examples or the class name euc_dist, but, regardless, I don't see much we can do at this point.

kruegers commented 6 years ago

@dd23 In preparation for the on-site review, could you please repackage the jar file for the ABY-task we've integrated into CogniCrypt and rename both the ABY_Examples package and the euc_dist class into something without an underscore? It's a long shot, I admit, but if you have the time, it's worth trying, I think.

dd23 commented 6 years ago

Here's the new JAR with the package and class renamed. (in a zip file, since I cannot upload jars directly) jar.zip Let me know if that helps.

kruegers commented 6 years ago

Thanks, @dd23 . Unfortunately, that didn't fix the issue. I will investigate this problem at a later point.

kruegers commented 6 years ago

I was able to reproduce the issue with a toy example. It turns out the issue was not the underscore but the lowercase e in the beginning of the name. No idea, why Eclipse's organize-imports feature can't handle it, but it works (in my toy example) when I change the letter to be uppercase.

Sorry to bother you again, @dd23, but could you please rename both the euclidean distance and the millionaire class such that their name begins with a capital letter and subsequently repackage the jar? Thanks. (Underscores are not really common in Java class and package names, so you don't really have to put them back in, as far as I'm concerned.)

dd23 commented 6 years ago

Here's a jar with uppercase classes: JAR.zip