ABY Framework
1.0
Arithmetic Bool Yao Framework
|
Implementation of the millionaire problem using ABY Framework. More...
#include "millionaire_prob.h"
Functions | |
int32_t | test_millionaire_prob_circuit (e_role role, char *address, seclvl seclvl, uint32_t nvals, uint32_t bitlen, uint32_t nthreads, e_mt_gen_alg mt_alg, e_sharing sharing) |
This function is used for running a testing environment for solving the millionaire's problem. More... | |
share * | BuildMillionaireProbCircuit (share *s_alice, share *s_bob, BooleanCircuit *bc) |
This function is used to build and solve the millionaire's problem. More... | |
Implementation of the millionaire problem using ABY Framework.
share* BuildMillionaireProbCircuit | ( | share * | s_alice, |
share * | s_bob, | ||
BooleanCircuit * | bc | ||
) |
This function is used to build and solve the millionaire's problem.
s_alice | shared object of alice. |
s_bob | shared object of bob. |
bc | boolean circuit object. |
Calling the greater than equal function in the Boolean circuit class.
int32_t test_millionaire_prob_circuit | ( | e_role | role, |
char * | address, | ||
seclvl | seclvl, | ||
uint32_t | nvals, | ||
uint32_t | bitlen, | ||
uint32_t | nthreads, | ||
e_mt_gen_alg | mt_alg, | ||
e_sharing | sharing | ||
) |
This function is used for running a testing environment for solving the millionaire's problem.
role | role played by the program which can be server or client part. |
address | IP Address |
seclvl | Security level |
nvals | Number of values |
bitlen | Bit length of the inputs |
nthreads | Number of threads |
mt_alg | The algorithm for generation of multiplication triples |
sharing | Sharing type object |
Step 1: Create the ABYParty object which defines the basis of all the operations which are happening. Operations performed are on the basis of the role played by this object.
Step 2: Get to know all the sharing types available in the program.
Step 3: Create the circuit object on the basis of the sharing type being inputed.
Step 4: Creating the share objects - s_alice_money, s_bob_money which is used as input to the computation function. Also s_out which stores the output.
Step 5: Initialize Alice's and Bob's money with random values. Both parties use the same seed, to be able to verify the result. In a real example each party would only supply one input value.
Step 6: Copy the randomly generated money into the respective share objects using the circuit object method PUTInGate(). Also mention who is sharing the object. The value for the party different from role is ignored, but PutINGate() must always be called for both roles.
Step 7: Call the build method for building the circuit for the problem by passing the shared objects and circuit object. Don't forget to type cast the circuit object to type of share
Step 8: Modify the output receiver based on the role played by the server and the client. This step writes the output to the shared output object based on the role.
Step 9: Executing the circuit using the ABYParty object evaluate the problem.
Step 10:Type casting the value to 32 bit unsigned integer for output.