You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a key already configured in `mix-node/config/crypto.json`. However, the `secret_key` will be different for each node, this will be overriden with environment variables later.
Now that the network of mix-nodes is up and running, we can run the client that will request a comparison:
85
+
```bash
86
+
# two codes of length 10
87
+
cargo run --example demo -- 10
88
+
89
+
# two codes of length 12800
90
+
cargo run --example demo -- 12800
91
+
```
92
+
**Note:** Because the servers are running on the same machine and the operations are very CPU heavy, the performance is not truly representative of a real-world deployment.
93
+
94
+
### How it Works
95
+
96
+
The client:
97
+
1. Requests the public key to encrypt the codes (instead of hardcoding it)
98
+
2. Generates a random code with the given length and clones it (both codes will be identical)
99
+
3. Encrypts both codes and sends a request to "http://localhost:6000/hamming"
100
+
4. Since the codes are identical, the expected hamming distance is 0
101
+
102
+
### Testing Threshold Decryption
103
+
104
+
To test threshold decryption:
105
+
1. Shutdown the mix-node on port `6002` and run the client again - it should still compute the hamming distance
106
+
2. Shutdown another mix-node (port `6001`) - the network can no longer compute the hamming distance because the number of nodes is below the threshold, returning an error
107
+
108
+
The code for the client can be found at `mix-node/examples/demo`.
0 commit comments