// Verifies if the partial decryption key is well formed.  If well formed,
// the method return nil else an explicative error is returned.
Verifies if the partial decryption key is well formed.  If well formed,
the method return nil else an explicative error is returned.
// Verifies if the partial decryption key is well formed . If well formed // the method return nil else an explicative error is returned .
func (tpk *ThresholdPrivateKey) Validate(random io.Reader) error {
	m, err := rand.Int(random, tpk.N)
	if err != nil {
		return err
	}
	c, err := tpk.Encrypt(m, random)
	if err != nil {
		return err
	}
	proof, err := tpk.DecryptAndProduceZNP(c.C, random)
	if err != nil {
		return err
	}
	if !proof.Verify() {
		return errors.New("invalid share.")
	}
	return nil
}
func ( tpk * ThresholdPrivateKey ) Validate ( random io . Reader ) error { m , err := rand . Int ( random , tpk . N ) if err != nil { return err } c , err := tpk . Encrypt ( m , random ) if err != nil { return err } proof , err := tpk . DecryptAndProduceZNP ( c . C , random ) if err != nil { return err } if ! proof . Verify ( ) { return errors . New ( " " ) } return nil }
Verifies if the partial decryption key is well formed.
Verifies if the partial decryption key is well formed .