data61 / MP-SPDZ

Versatile framework for multi-party computation
Other
925 stars 278 forks source link

Getting a `public value too long` error when compiling a binary circuit #800

Closed Mikerah closed 1 year ago

Mikerah commented 1 year ago

When trying to run this program using ./compile -B 64 ../knapsack.mpc and ./Scripts/shamir-bmr.sh, I get the following error:

Using security parameter 40
terminate called after throwing an instance of 'std::out_of_range'
  what():  public value too long
/home/mikerah/Documents/HashCloak/Projects/flashbots-privacy/mpc_block_knapsack/MP-SPDZ/Scripts/run-common.sh: line 53: 2298742 Aborted                 (core dumped) $prefix $SPDZROOT/$bin $i $params 2>&1
     2298743 Done                    | { if test $i = 0; then
    tee $log;
else
    cat > $log;
fi; }

Upon a further look, it appears that either FakeSecrets.cpp or Secret.hpp is raising this error. Based on the code, it's unclear to me what is wrong. Any tips on how to resolve this?

mkskeller commented 1 year ago

Thank you for raising this. This is due to a bug when subtracting a secret value from a cleartext value. You should find that e9b9df9a49d205f583b2971f54d23087f4e93a60 fixes this.

Mikerah commented 1 year ago

This worked. Thank you