// NewDamgardFujisakiReceiver receives two parameters: safePrimeBitLength tells the length of the
// primes in QRSpecialRSA group, k is security parameter on which it depends the hiding property
// (commitment c = G^a * H^r where r is chosen randomly from (0, 2^(B+k)) - the distribution of
// c is statistically close to uniform, 2^B is upper bound estimation for group order).
NewDamgardFujisakiReceiver receives two parameters: safePrimeBitLength tells the length of the
primes in QRSpecialRSA group, k is security parameter on which it depends the hiding property
(commitment c = G^a * H^r where r is chosen randomly from (0, 2^(B+k)) - the distribution of
c is statistically close to uniform, 2^B is upper bound estimation for group order).
// NewDamgardFujisakiReceiver receives two parameters : safePrimeBitLength tells the length of the // primes in QRSpecialRSA group k is security parameter on which it depends the hiding property // ( commitment c = G^a * H^r where r is chosen randomly from ( 0 2^ ( B + k )) - the distribution of // c is statistically close to uniform 2^B is upper bound estimation for group order ) .
func NewDamgardFujisakiReceiver(safePrimeBitLength, k int) (*DamgardFujisakiReceiver, error) {
	if safePrimeBitLength < 1024 {
		return nil, fmt.Errorf("safe prime bit length is too small")
	}
	qr, err := groups.NewQRSpecialRSA(safePrimeBitLength)
	if err != nil {
		return nil, err
	}
	h, err := qr.GetRandomGenerator()
	if err != nil {
		return nil, err
	}
	alpha := common.GetRandomInt(qr.Order)
	g := qr.Exp(h, alpha)
	if err != nil {
		return nil, err
	}
	return &DamgardFujisakiReceiver{damgardFujisaki: damgardFujisaki{
			QRSpecialRSA: qr,
			H:            h,
			G:            g,
			K:            k}},
		nil
}
func NewDamgardFujisakiReceiver ( safePrimeBitLength , k int ) ( * DamgardFujisakiReceiver , error ) { if safePrimeBitLength < 1024 { return nil , fmt . Errorf ( " " ) } qr , err := groups . NewQRSpecialRSA ( safePrimeBitLength ) if err != nil { return nil , err } h , err := qr . GetRandomGenerator ( ) if err != nil { return nil , err } alpha := common . GetRandomInt ( qr . Order ) g := qr . Exp ( h , alpha ) if err != nil { return nil , err } return & DamgardFujisakiReceiver { damgardFujisaki : damgardFujisaki { QRSpecialRSA : qr , H : h , G : g , K : k } } , nil }
NewDamgardFujisakiReceiver receives two parameters: safePrimeBitLength tells the length of the
primes in QRSpecialRSA group, k is security parameter on which it depends the hiding property
(commitment c = G^a * H^r where r is chosen randomly from (0, 2^(B+k)) - the distribution of
c is statistically close to uniform, 2^B is upper bound estimation for group order).
NewDamgardFujisakiReceiver receives two parameters : safePrimeBitLength tells the length of the primes in QRSpecialRSA group k is security parameter on which it depends the hiding property ( commitment c = G^a * H^r where r is chosen randomly from ( 0 2^ ( B + k )) - the distribution of c is statistically close to uniform 2^B is upper bound estimation for group order ) .
// TODO: check if there are some other places where such errors should be raised