Skip to content

MPC: modulo not working as expected #228

@sebw42

Description

@sebw42

Hi, the MPC compiler on the mpc_aws branch seems to have an issue with the modulo operation.
Here is an example:

int main() {
    return (0-1) % 10;
}

This returns 5.

It works as expected when using a secret input instead of 0-1:

int main(__attribute__(private(0)) int x) {
    return x % 10;
}

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

Thanks 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