// NewSchnorrGroup generates random SchnorrGroup with generator G and
// parameters P and Q where P = R * Q + 1 for some R. Order of G is Q.
NewSchnorrGroup generates random SchnorrGroup with generator G and
parameters P and Q where P = R * Q + 1 for some R. Order of G is Q.
// NewSchnorrGroup generates random SchnorrGroup with generator G and // parameters P and Q where P = R * Q + 1 for some R . Order of G is Q .
func NewSchnorrGroup(qBitLength int) (*SchnorrGroup, error) {
	sizes := dsa.L1024N160
	if qBitLength == 160 {
		sizes = dsa.L1024N160
	} else if qBitLength == 224 {
		sizes = dsa.L2048N224
	} else if qBitLength == 256 {
		sizes = dsa.L2048N256
	} else {
		err := fmt.Errorf("generating Schnorr primes for bit length %d is not supported", qBitLength)
		return nil, err
	}
	params := dsa.Parameters{}
	err := dsa.GenerateParameters(&params, rand.Reader, sizes)
	if err != nil {
		return nil, err
	}
	return &SchnorrGroup{
		P: params.P,
		G: params.G,
		Q: params.Q,
	}, nil
}
func NewSchnorrGroup ( qBitLength int ) ( * SchnorrGroup , error ) { sizes := dsa . L1024N160 if qBitLength == 160 { sizes = dsa . L1024N160 } else if qBitLength == 224 { sizes = dsa . L2048N224 } else if qBitLength == 256 { sizes = dsa . L2048N256 } else { err := fmt . Errorf ( " " , qBitLength ) return nil , err } params := dsa . Parameters { } err := dsa . GenerateParameters ( & params , rand . Reader , sizes ) if err != nil { return nil , err } return & SchnorrGroup { P : params . P , G : params . G , Q : params . Q , } , nil }
NewSchnorrGroup generates random SchnorrGroup with generator G and
parameters P and Q where P = R * Q + 1 for some R. Order of G is Q.
NewSchnorrGroup generates random SchnorrGroup with generator G and parameters P and Q where P = R * Q + 1 for some R . Order of G is Q .
// Using DSA GenerateParameters: