mirror of
https://github.com/tuneinsight/lattigo.git
synced 2025-09-13 03:27:14 +00:00
AdditiveShare API uses vector size instead of logslot
This commit is contained in:
@@ -28,11 +28,12 @@ type EncToShareProtocol struct {
|
||||
|
||||
func NewAdditiveShare(params ckks.Parameters, logSlots int) drlwe.AdditiveShareBigint {
|
||||
|
||||
nValues := 1 << logSlots
|
||||
if params.RingType() == ring.Standard {
|
||||
logSlots++
|
||||
nValues <<= 1
|
||||
}
|
||||
|
||||
return drlwe.NewAdditiveShareBigint(logSlots)
|
||||
return drlwe.NewAdditiveShareBigint(nValues)
|
||||
}
|
||||
|
||||
// ShallowCopy creates a shallow copy of EncToShareProtocol in which all the read-only data-structures are
|
||||
|
||||
@@ -23,11 +23,8 @@ func NewAdditiveShare(r *ring.Ring) AdditiveShare {
|
||||
return AdditiveShare{Value: r.NewPoly()}
|
||||
}
|
||||
|
||||
// NewAdditiveShareBigint instantiates a new additive share struct composed of "2^logslots" big.Int elements.
|
||||
func NewAdditiveShareBigint(logSlots int) AdditiveShareBigint {
|
||||
|
||||
n := 1 << logSlots
|
||||
|
||||
// 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)
|
||||
|
||||
Reference in New Issue
Block a user