123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- #ifndef __MPCOPS_HPP__
- #define __MPCOPS_HPP__
- #include "types.hpp"
- #include "mpcio.hpp"
- #include "coroutine.hpp"
- void mpc_mul(MPCTIO &tio, yield_t &yield,
- RegAS &z, RegAS x, RegAS y,
- nbits_t nbits = VALUE_BITS);
- void mpc_cross(MPCTIO &tio, yield_t &yield,
- RegAS &z, RegAS x, RegAS y,
- nbits_t nbits = VALUE_BITS);
- void mpc_valuemul(MPCTIO &tio, yield_t &yield,
- RegAS &z, value_t x,
- nbits_t nbits = VALUE_BITS, bool tally = true);
- void mpc_flagmult(MPCTIO &tio, yield_t &yield,
- RegAS &z, RegBS f, RegAS y,
- nbits_t nbits = VALUE_BITS);
- void mpc_select(MPCTIO &tio, yield_t &yield,
- RegAS &z, RegBS f, RegAS x, RegAS y,
- nbits_t nbits = VALUE_BITS);
- void mpc_select(MPCTIO &tio, yield_t &yield,
- RegXS &z, RegBS f, RegXS x, RegXS y,
- nbits_t nbits = VALUE_BITS);
- void mpc_select(MPCTIO &tio, yield_t &yield,
- RegBS &z, RegBS f, RegBS x, RegBS y);
- void mpc_oswap(MPCTIO &tio, yield_t &yield,
- RegAS &x, RegAS &y, RegBS f,
- nbits_t nbits = VALUE_BITS);
- void mpc_xs_to_as(MPCTIO &tio, yield_t &yield,
- RegAS &as_x, RegXS xs_x,
- nbits_t nbits = VALUE_BITS, bool tally = true);
- value_t mpc_reconstruct(MPCTIO &tio, yield_t &yield,
- RegXS f, nbits_t nbits = VALUE_BITS);
- value_t mpc_reconstruct(MPCTIO &tio, yield_t &yield,
- RegAS x, nbits_t nbits = VALUE_BITS);
- bool mpc_reconstruct(MPCTIO &tio, yield_t &yield, RegBS x);
- void mpc_reconstruct_choice(MPCTIO &tio, yield_t &yield,
- DPFnode &z, RegBS f, DPFnode x, DPFnode y);
- template <size_t LWIDTH>
- void mpc_reconstruct_choice(MPCTIO &tio, yield_t &yield,
- std::array<DPFnode,LWIDTH> &z, RegBS f,
- const std::array<DPFnode,LWIDTH> &x,
- const std::array<DPFnode,LWIDTH> &y);
- void mpc_and(MPCTIO &tio, yield_t &yield,
- RegBS &z, RegBS x, RegBS y);
- void mpc_or(MPCTIO &tio, yield_t &yield,
- RegBS &z, RegBS x, RegBS y);
- #include "mpcops.tcc"
- #endif
|