comparison_protocol

该协议实现加密数据的比较。

参与者A拥有公钥,并且最终获得加密的结果:

// party A has the public parameters and gets the encrypted result
class Comparison_protocol_A {
public:
    virtual void set_value(const mpz_class &x) = 0;
    virtual size_t bit_length() const { return 0; }
    virtual void set_bit_length(size_t l) = 0;
    
    virtual mpz_class output() const = 0;
    virtual GM gm() const = 0;
};

参与者B拥有私钥:

// party B has the secret parameters
class Comparison_protocol_B {
public:
    virtual void set_value(const mpz_class &x) = 0;
    virtual size_t bit_length() const { return 0; }
    virtual void set_bit_length(size_t l) = 0;

    virtual GM_priv gm() const = 0;
};

你可能感兴趣的:(密码学相关)