This repo contains companinion code for the ACM CCS'19 paper Efficient MPC via Program Analysis: A Framework for Efficient Optimal Mixing
- analysis-project contains a gradle java project for analysis (you need to have gradle installed to build/run analysis project).
- solver contains OPA solver MATLAB code.
- Java SDK 8 (
openjdk-8-sdk)
-
Analysis project needs to know the classpath (option
-cp) and class name (option-c) of the program to generate anlaysis file for. It uses defaults for the path ofrt.jar(option-r) andjce.jar(option-j). If those default values are wrong, it will complain and you'll have to specify those paths on command line too.To generate analysis for, for example, the gcd benchmark, run:
./gradlew run --args='-c P -cp ./src/test/resources/programs/gcd'You can change the
-cand-cpparams to other benchmarks to test them. Analysis output is written toanalysis.json. -
Edit
solver.m(in solver directory) to point to theanalysis.jsonand run it to get protocol assignment.
You can run ./gradlew eclipse to generate eclipse project and then import it into eclipse as an Existing Gradle Project.
Once the project is open in Eclipse, right-click ./src/test/java/MainTest.java and
choose Debug As -> Gradle Test to debug it (with breakpoints and other debugging aids).
Follow the examples in src/test/resources/programs directory in the analysis project directory. Briefly the programs should:
- only contain very simple
ifstatements (current support for analyzingifis a simple heuristic.) - loops should have statically known bounds (this is a standard limitation of MPC).
- only contain
public staticfunctions. - input and output variables should be marked using function calls to
MPCAnnotation. This ensures that such variables do not get eliminated as dead code during analysis.
MIT License. see LICENSE for details.
- If running analysis (whether through eclipse or commandline) gives you
unable to load java.lang.CharSequence(or similar) error. Try running the analysis on a compiled.classfile instead of java souce. Soot's java frontend is outdated and running it against compiled program fixes many issues.