Skip to content

MPC: Unexpected results when using division #215

@sebw42

Description

@sebw42

Hi, I'm trying to compile to mpc on the mpc_aws branch and noticed that the division operator sometimes does not work as expected with some of the options for --selection-scheme (for example "smart_lp").

Here is an example (a is set to 1 in the input txt file):

int main(__attribute__((private(0))) int a) {
    return 42 / (1 + (a - a)); // or (a * 2), (a * a) etc
}

Build command (run from the CirC root dir):

export CARGO_MANIFEST_DIR="$PWD"; ./target/release/examples/circ --parties 2 examples/C/mpc/program.c mpc  --cost-model "empirical" --selection-scheme "smart_lp"

Execution:

/path/to/ABY/build/bin/aby_interpreter -m mpc -f ./scripts/aby_tests/tests/program_c -t ./scripts/aby_tests/test_inputs/program.txt -r 0 & /path/to/ABY/build/bin/aby_interpreter -m mpc -f ./scripts/aby_tests/tests/program_c -t ./scripts/aby_tests/test_inputs/program.txt -r 1

This results in a seemingly random number (a different one on every execution).

The error seems to only occur if the right operand involves a computation with a runtime value.

I also tried different selection schemes. It works with e.g. "lp", but fails with others such as "css" or "smart_glp".
Are some selection schemes not safe to use with certain operations, or am I using the toolchain wrong?
Thank you for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions