/* * MalicousCcdShare.h * */ #ifndef GC_MALICIOUSCCDSHARE_H_ #define GC_MALICIOUSCCDSHARE_H_ #include "CcdShare.h" #include "Protocols/MaliciousShamirShare.h" template class MaliciousBitOnlyRepPrep; namespace GC { template class MaliciousCcdSecret; template class MaliciousCcdShare: public MaliciousShamirShare, public ShareSecret< MaliciousCcdSecret> { typedef MaliciousCcdShare This; public: typedef MaliciousShamirShare super; typedef Bit clear; typedef MaliciousRepPrep LivePrep; typedef ShamirInput Input; typedef Beaver Protocol; typedef MaliciousShamirMC MAC_Check; typedef MAC_Check Direct_MC; typedef This small_type; typedef NoShare bit_type; static const int default_length = 1; static string name() { return "Malicious CCD"; } static MAC_Check* new_mc(typename super::mac_key_type) { return new MAC_Check; } MaliciousCcdShare() { } MaliciousCcdShare(const MaliciousCcdSecret& other) : super(other.get_bit(0)) { } template MaliciousCcdShare(const U& other) : super(other) { } void XOR(const This& a, const This& b) { *this = a + b; } void public_input(bool input) { *this = input; } This& operator^=(const This& other) { *this += other; return *this; } This get_bit(int i) { assert(i == 0); return *this; } }; template const int MaliciousCcdShare::default_length; } /* namespace GC */ #endif /* GC_MALICIOUSCCDSHARE_H_ */