You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code should produce polynomials with independent and identically distributed coefficients but ends up producing polynomials with overlapping coefficients:
package main
import(
"fmt"
"github.com/tuneinsight/lattigo/v5/core/rlwe"
"github.com/tuneinsight/lattigo/v5/utils/sampling"
"github.com/tuneinsight/lattigo/v5/ring"
)
func main(){
params, err := rlwe.NewParametersFromLiteral(rlwe.ParametersLiteral{
LogN: 10,
LogQ: []int{50},
})
if err != nil{
panic(err)
}
prng, _ := sampling.NewKeyedPRNG([]byte{0x02})
uniform := ring.NewUniformSampler(prng, params.RingQ())
_ = uniform.ReadNew()
a0 := uniform.AtLevel(0).ReadNew()
a1 := uniform.AtLevel(0).ReadNew()
m := map[uint64]int{}
for i, v := range a0.Coeffs[0]{
m[v] = i
}
for i, v := range a1.Coeffs[0]{
if j, ok := m[v]; ok{
fmt.Println(a0.Coeffs[0][j:j+8])
fmt.Println(a1.Coeffs[0][i:i+8])
break
}
}
}
The text was updated successfully, but these errors were encountered:
The following code should produce polynomials with independent and identically distributed coefficients but ends up producing polynomials with overlapping coefficients:
The text was updated successfully, but these errors were encountered: