// GetRandomIntOfLength returns random *big.Int exactly of length bitLengh.
GetRandomIntOfLength returns random *big.Int exactly of length bitLengh.
// GetRandomIntOfLength returns random * big . Int exactly of length bitLengh .
func GetRandomIntOfLength(bitLength int) *big.Int {
	max := new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(bitLength-1)), nil)
	o := GetRandomInt(max)
	r := new(big.Int).Add(max, o)
	b1 := r.Cmp(new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(bitLength-1)), nil))
	b2 := r.Cmp(new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(bitLength)), nil))
	if (b1 != 1) || (b2 != -1) {
		log.Panic("parameter not properly chosen")
	}
	return r
}
func GetRandomIntOfLength ( bitLength int ) * big . Int { max := new ( big . Int ) . Exp ( big . NewInt ( 2 ) , big . NewInt ( int64 ( bitLength - 1 ) ) , nil ) o := GetRandomInt ( max ) r := new ( big . Int ) . Add ( max , o ) b1 := r . Cmp ( new ( big . Int ) . Exp ( big . NewInt ( 2 ) , big . NewInt ( int64 ( bitLength - 1 ) ) , nil ) ) b2 := r . Cmp ( new ( big . Int ) . Exp ( big . NewInt ( 2 ) , big . NewInt ( int64 ( bitLength ) ) , nil ) ) if ( b1 != 1 ) || ( b2 != - 1 ) { log . Panic ( " " ) } return r }
GetRandomIntOfLength returns random *big.Int exactly of length bitLengh.
GetRandomIntOfLength returns random * big . Int exactly of length bitLengh .
// choose a random number a of length bitLength // that means: 2^(bitLength-1) < a < 2^(bitLength) // choose a random from [0, 2^(bitLength-1)) and add it to 2^(bitLength-1)