correctly copy ringqp polynomial

This commit is contained in:
Andrea Caforio
2024-06-04 16:15:50 +02:00
parent 3dce5b5336
commit 96b11fc917

View File

@@ -5,7 +5,6 @@ import (
"io"
"github.com/tuneinsight/lattigo/v5/ring"
"github.com/tuneinsight/lattigo/v5/utils"
"github.com/tuneinsight/lattigo/v5/utils/buffer"
)
@@ -55,7 +54,8 @@ func (p Poly) Equal(other *Poly) (v bool) {
// Copy copies the coefficients of other on the target polynomial.
// This method simply calls the Copy method for each of its sub-polynomials.
func (p *Poly) Copy(other Poly) {
p.CopyLvl(utils.Min(p.LevelQ(), other.LevelQ()), utils.Min(p.LevelP(), other.LevelP()), other)
p.Q.Copy(other.Q)
p.P.Copy(other.P)
}
// CopyLvl copies the values of other on the target polynomial.