func (c *DamgardDecMultiClient) GenerateKeys() (*DamgardDecMultiSecKey, error) {
	masterSecretKey, masterPublicKey, err := c.Damgard.GenerateMasterKeys()
	if err != nil {
		return nil, fmt.Errorf("error in master key generation")
	}
	otpVector, err := data.NewRandomVector(c.Damgard.Params.L,
		sample.NewUniform(c.Damgard.Params.Q))
	if err != nil {
		return nil, fmt.Errorf("error in random vector generation")
	}
	return &DamgardDecMultiSecKey{sk: masterSecretKey,
		pk:     masterPublicKey,
		OtpKey: otpVector}, nil
}
GenerateKeys generates the secret key for each client.

It returns an error in case master keys could not be generated.
package fullysec
import (
	"crypto/sha256"
	"fmt"
	"math/big"
	"github.com/fentec-project/gofe/data"
	"github.com/fentec-project/gofe/sample"
)
type DamgardDecMultiClient struct {
	Idx int
	*DamgardMulti
	ClientPubKey *big.Int
	ClientSecKey *big.Int
	Share        data.Matrix
}
func NewDamgardDecMultiClient(idx int, damgardMulti *DamgardMulti) (*DamgardDecMultiClient, error) {
	sampler := sample.NewUniform(damgardMulti.Params.Q)
	sec, err := sampler.Sample()
	if err != nil {
		return nil, fmt.Errorf("could not generate random value")
	}
	pub := new(big.Int).Exp(damgardMulti.Params.G, sec, damgardMulti.Params.P)
	return &DamgardDecMultiClient{
		Idx:          idx,
		DamgardMulti: damgardMulti,
		ClientPubKey: pub,
		ClientSecKey: sec,
	}, nil
}
func (c *DamgardDecMultiClient) SetShare(pubKeys []*big.Int) error {
	c.Share = data.NewConstantMatrix(c.NumClients, c.Params.L, big.NewInt(0))
	var add data.Matrix
	var err error
	for k := 0; k < len(pubKeys); k++ {
		if k == c.Idx {
			continue
		}
		sharedNum := new(big.Int).Exp(pubKeys[k], c.ClientSecKey, c.Params.P)
		sharedKey := sha256.Sum256([]byte(sharedNum.String()))
		add, err = data.NewRandomDetMatrix(c.NumClients, c.Params.L, c.Params.Q, &sharedKey)
		if err != nil {
			return err
		}
		if k < c.Idx {
			c.Share, err = c.Share.Add(add)
			if err != nil {
				return err
			}
		} else {
			c.Share, err = c.Share.Sub(add)
			if err != nil {
				return err
			}
		}
		c.Share = c.Share.Mod(c.Params.Q)
	}
	return nil
}
type DamgardDecMultiSecKey struct {
	sk     *DamgardSecKey
	pk     data.Vector
	OtpKey data.Vector
}