// IsElementInGroup returns true if a is in QR_N and false otherwise.
IsElementInGroup returns true if a is in QR_N and false otherwise.
// IsElementInGroup returns true if a is in QR_N and false otherwise .
func (group *QRRSA) IsElementInGroup(a *big.Int) (bool, error) {
	if group.P == nil {
		return false,
			fmt.Errorf("IsElementInGroup not available for QRRSA with only public parameters")
	}
	factors := []*big.Int{group.P, group.Q}
	for _, p := range factors {
		isQR, err := common.IsQuadraticResidue(a, p)
		if err != nil {
			return false, err
		}
		if !isQR {
			return false, nil
		}
	}
	return true, nil
}
func ( group * QRRSA ) IsElementInGroup ( a * big . Int ) ( bool , error ) { if group . P == nil { return false , fmt . Errorf ( " " ) } factors := [ ] * big . Int { group . P , group . Q } for _ , p := range factors { isQR , err := common . IsQuadraticResidue ( a , p ) if err != nil { return false , err } if ! isQR { return false , nil } } return true , nil }
IsElementInGroup returns true if a is in QR_N and false otherwise.
IsElementInGroup returns true if a is in QR_N and false otherwise .