Skip to content

MPC: unexpected output when accessing arrays #226

@sebw42

Description

@sebw42

Hello, I have noticed an issue with the MPC compiler on the mpc_aws branch.
In some cases, accessing arrays containing both run-time and compile-time values returns wrong results.
Here is an example (x is set to 10 in the input file):

int main(__attribute__((private(0))) int x){
    int arr[2] = {1, x};
    return arr[0]; // returns 0
}

Compilation command:

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

Execution command:

/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 error only seems to occur when using --selection-scheme css.

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