Skip to content

Commit

Permalink
fix: Fix RingPack
Browse files Browse the repository at this point in the history
  • Loading branch information
sp301415 committed Oct 28, 2024
1 parent afe299f commit a903f52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xtfhe/bfv_evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ func (e *BFVEvaluator[T]) RingPackAssign(ct tfhe.LWECiphertext[T], ctOut tfhe.GL
ctOut.Value[0].Clear()
ctOut.Value[0].Coeffs[0] = num.DivRoundBits(ct.Value[0], e.Parameters.LogPolyDegree())

ctOut.Value[1].Coeffs[0] = ct.Value[1]
ctOut.Value[1].Coeffs[0] = num.DivRoundBits(ct.Value[1], e.Parameters.LogPolyDegree())
for i := 1; i < e.Parameters.PolyDegree(); i++ {
ctOut.Value[1].Coeffs[e.Parameters.PolyDegree()-i] = num.DivRoundBits(-ct.Value[i+1], e.Parameters.LogPolyDegree())
ctOut.Value[1].Coeffs[e.Parameters.PolyDegree()-i] = -num.DivRoundBits(ct.Value[i+1], e.Parameters.LogPolyDegree())
}

for i := 0; i < e.Parameters.LogPolyDegree(); i++ {
Expand Down

0 comments on commit a903f52

Please sign in to comment.