def __init__(self, private_key = None):
        # Generate private key
        if private_key != None:
            if len(private_key) != self.group_len:
                raise ValueError("private_key is a invalid length (Expected %d, got %d)" % (group_len, len(private_key)))
            self.priv_str = private_key
        else:
            self.priv_str = rand.random_bytes(self.group_len)
        self.priv = int(binascii.hexlify(self.priv_str), 16)

        # Make the private key even
        flip = self.priv % 2
        self.priv -= flip

        # Generate public key
        #
        # Note: Always generate both valid public keys, and then pick to avoid
        # leaking timing information about which key was chosen.
        pub = modexp.powMod(self.g, self.priv, self.mod)
        pub_p_sub_X = self.mod - pub
        if flip == 1:
            self.pub = pub_p_sub_X
        else:
            self.pub = pub
        self.pub_str = int_to_bytes(self.pub, self.group_len)

        self.shared_secret = None
dataset/ETHPy150Open isislovecruft/obfsproxy/obfsproxy/transports/obfs3_dh.py/UniformDH.__init__/original