// ProveQNR demonstrates how the prover can prove that y is not quadratic residue (there does
// not exist element y1 such that y1^2 = y in group QRRSA.
ProveQNR demonstrates how the prover can prove that y is not quadratic residue (there does
not exist element y1 such that y1^2 = y in group QRRSA.
// ProveQNR demonstrates how the prover can prove that y is not quadratic residue ( there does // not exist element y1 such that y1^2 = y in group QRRSA .
func ProveQNR(y *big.Int, qr *groups.QRRSA) (bool, error) {
	prover := NewQNRProver(qr, y)
	verifier := NewQNRVerifier(qr, y)
	m := qr.N.BitLen()
	for i := 0; i < m; i++ {
		w, pairs := verifier.GetChallenge()
		prover.SetProofRandomData(w)
		randVector := prover.GetChallenge()
		verProof := verifier.GetProofData(randVector)
		verifierIsHonest := prover.Verify(pairs, verProof)
		if !verifierIsHonest {
			err := fmt.Errorf("verifier is not honest")
			return false, err
		}
		typ, err := prover.GetProofData(w)
		if err != nil {
			return false, nil
		}
		proved := verifier.Verify(typ)
		if !proved {
			return false, nil
		}
	}
	return true, nil
}
func ProveQNR ( y * big . Int , qr * groups . QRRSA ) ( bool , error ) { prover := NewQNRProver ( qr , y ) verifier := NewQNRVerifier ( qr , y ) m := qr . N . BitLen ( ) for i := 0 ; i < m ; i ++ { w , pairs := verifier . GetChallenge ( ) prover . SetProofRandomData ( w ) randVector := prover . GetChallenge ( ) verProof := verifier . GetProofData ( randVector ) verifierIsHonest := prover . Verify ( pairs , verProof ) if ! verifierIsHonest { err := fmt . Errorf ( " " ) return false , err } typ , err := prover . GetProofData ( w ) if err != nil { return false , nil } proved := verifier . Verify ( typ ) if ! proved { return false , nil } } return true , nil }
ProveQNR demonstrates how the prover can prove that y is not quadratic residue (there does
not exist element y1 such that y1^2 = y in group QRRSA.
ProveQNR demonstrates how the prover can prove that y is not quadratic residue ( there does not exist element y1 such that y1^2 = y in group QRRSA .
// get challenge from prover for proving that verifier is not cheating