Skip to content

Commit

Permalink
do not mix log/non-log primes for Q and P in rlwe.ParametersLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
qantik committed May 13, 2024
1 parent 2a3b223 commit b5ea9e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/rlwe/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,11 @@ func NewParametersFromLiteral(paramDef ParametersLiteral) (params Parameters, er
paramDef.DefaultScale = s
}

// only allow either (Q or P) or (logQ or logP), do not mix log with non-log
switch {
case paramDef.Q != nil && paramDef.LogQ == nil:
case paramDef.Q != nil && paramDef.LogQ == nil && paramDef.LogP == nil:
return NewParameters(paramDef.LogN, paramDef.Q, paramDef.P, paramDef.Xs, paramDef.Xe, paramDef.RingType, paramDef.DefaultScale, paramDef.NTTFlag)
case paramDef.LogQ != nil && paramDef.Q == nil:
case paramDef.LogQ != nil && paramDef.Q == nil && paramDef.P == nil:
var q, p []uint64
switch paramDef.RingType {
case ring.Standard:
Expand Down

0 comments on commit b5ea9e2

Please sign in to comment.