Files
zeekay eaf864890e feat: release v7.0.0 with GPU acceleration and module update
- Update module path to github.com/luxfi/lattice/v7
- Add GPU acceleration with Metal (macOS) and CUDA backends
- Enhance threshold FHE operations
- Revert to vanilla Apache 2.0 license (remove tfhe)
- Update Go version to 1.25.5
- Merge upstream lattigo improvements
2025-12-30 15:37:37 -08:00

34 lines
864 B
Go

package multiparty
import (
"math/big"
"github.com/luxfi/lattice/v7/ring"
)
// AdditiveShare is a type for storing additively shared values in Z_Q[X] (RNS domain).
type AdditiveShare struct {
Value ring.Poly
}
// AdditiveShareBigint is a type for storing additively shared values
// in Z (positional domain).
type AdditiveShareBigint struct {
Value []*big.Int
}
// NewAdditiveShare instantiates a new additive share struct for the ring defined
// by the given parameters at maximum level.
func NewAdditiveShare(r *ring.Ring) AdditiveShare {
return AdditiveShare{Value: r.NewPoly()}
}
// NewAdditiveShareBigint instantiates a new additive share struct composed of n [big.Int] elements.
func NewAdditiveShareBigint(n int) AdditiveShareBigint {
v := make([]*big.Int, n)
for i := range v {
v[i] = new(big.Int)
}
return AdditiveShareBigint{Value: v}
}