func GenerateKey() (*KeyPair, error) {
	var key KeyPair
	pub, priv, err := box.GenerateKey(rand.Reader)
	if err != nil {
		return nil, err
	}
	key.Public = PublicKey{*pub}
	key.Private = PrivateKey{*priv}
	return &key, nil
}
// GenerateKey generates a new key pair.
GenerateKey generates a new key pair.
// GenerateKey generates a new key pair .
func GenerateKey() (*KeyPair, error) {
	var key KeyPair
	pub, priv, err := box.GenerateKey(rand.Reader)
	if err != nil {
		return nil, err
	}
	key.Public = PublicKey{*pub}
	key.Private = PrivateKey{*priv}
	return &key, nil
}
func GenerateKey ( ) ( * KeyPair , error ) { var key KeyPair pub , priv , err := box . GenerateKey ( rand . Reader ) if err != nil { return nil , err } key . Public = PublicKey { * pub } key . Private = PrivateKey { * priv } return & key , nil }
GenerateKey generates a new key pair.
GenerateKey generates a new key pair .