emp-toolkit / emp-ag2pc

Authenticated Garbling and Efficient Maliciously Secure Two-Party Computation
Other
23 stars 19 forks source link

Make input const in `2pc.h` #29

Closed joerowell closed 2 years ago

joerowell commented 2 years ago

At the moment it's impossible to write this:

void do_garbling(const bool * const in, ...) {
  // Assume the 2pc object is called twopc
  bool out[128];
  twopc.online(in, out, false);
}

This is because in is not marked as const in 2pc.h:

void online(bool * input, bool * output, bool alice_output = false) { ...}

This PR just marks input as const. This doesn't affect the behaviour of the function at all, as input was already implicitly const (i.e it's never actually written to).

wangxiao1254 commented 2 years ago

Thanks!