// Verifies if the decryption of `encryptedMessage` has been done properly.
// It verifies all the zero-knoledge proofs, the value of the encrypted
// and decrypted message. The method returns `nil` if everything is fine.
// Otherwise, it returns an explicative message.
Verifies if the decryption of `encryptedMessage` has been done properly.
It verifies all the zero-knoledge proofs, the value of the encrypted
and decrypted message. The method returns `nil` if everything is fine.
Otherwise, it returns an explicative message.
// Verifies if the decryption of ` encryptedMessage ` has been done properly . // It verifies all the zero - knoledge proofs the value of the encrypted // and decrypted message . The method returns ` nil ` if everything is fine . // Otherwise it returns an explicative message .
func (tk *ThresholdPublicKey) VerifyDecryption(encryptedMessage, decryptedMessage *big.Int, shares []*PartialDecryptionZKP) error {
	for _, share := range shares {
		if share.C.Cmp(encryptedMessage) != 0 {
			return errors.New("The encrypted message is not the same than the one in the shares")
		}
	}
	res, err := tk.CombinePartialDecryptionsZKP(shares)
	if err != nil {
		return err
	}
	if res.Cmp(decryptedMessage) != 0 {
		return errors.New("The decrypted message is not the same than the one in the shares")
	}
	return nil
}
func ( tk * ThresholdPublicKey ) VerifyDecryption ( encryptedMessage , decryptedMessage * big . Int , shares [ ] * PartialDecryptionZKP ) error { for _ , share := range shares { if share . C . Cmp ( encryptedMessage ) != 0 { return errors . New ( " " ) } } res , err := tk . CombinePartialDecryptionsZKP ( shares ) if err != nil { return err } if res . Cmp ( decryptedMessage ) != 0 { return errors . New ( " " ) } return nil }
Verifies if the decryption of `encryptedMessage` has been done properly.
Verifies if the decryption of ` encryptedMessage ` has been done properly .