Compares images input by the parties. If any pixel in the images differ, then it will return to the parties that the images do not match. Otherwise, it will return that there was a match.
-
Running a server:
node demos/image-comparison/server.js
-
Either open browser based parties by going to http://localhost:8080/demos/image-comparison/client.html in the browser, or a node.js party by running
node demos/image-comparison/party.js
-
Running tests: run the following. Note that you do not need to have the server running when running the tests; they run the server on their own.
npm run-script test-demo -- demos/image-comparison/test.js
The demo consists of the following parts:
- Server script: server.js
- Web Based Party: Made from the following files:
- client.html: UI for the browser.
- client.js: Handlers for UI buttons and input validations.
- Node.js-Based Party:
- party.js: Main entry point. Parses input from the command line and initializes the computation.
- The MPC protocol: Implemented in mpc.js. This file is used in both the browser and node.js versions of the demo.
- test.js: mocha unit tests.
- Test images folder test_images
- This includes two images for testing purposes, one of which has a single pixel different than the other. When the computation is run with the two images as input, it should output that there is a difference between them.
- Documentation:
- This README.md file.