Skip to content

Commit

Permalink
Fixed previous fix to Linear.hs: we should *eval* with Dec coeffs, bu…
Browse files Browse the repository at this point in the history
…t *lift* in Pow basis.
  • Loading branch information
crockeea committed Nov 13, 2015
1 parent d36d513 commit 8577dbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Crypto/Lol/Cyclotomic/Linear.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ evalLin :: forall t z e r s .
(e `Divides` r, e `Divides` s, CElt t z)
=> Linear t z e r s -> Cyc t r z -> Cyc t s z
evalLin (D ys) r = sum (zipWith (*) ys $
embed <$> (coeffsCyc Pow r :: [Cyc t e z]))
embed <$> (coeffsCyc Dec r :: [Cyc t e z]))

instance Additive (Cyc t s z) => Additive.C (Linear t z e r s) where
zero = D []
Expand All @@ -67,7 +67,7 @@ instance (CElt t zp, CElt t z, z ~ LiftOf zp, Lift zp z, Fact s)
=> Lift' (Linear t zp e r s) where
type LiftOf (Linear t zp e r s) = Linear t (LiftOf zp) e r s

lift (D ys) = D $ liftCyc Dec <$> ys
lift (D ys) = D $ liftCyc Pow <$> ys

-- | A convenient constraint synonym for extending a linear function
-- to larger rings.
Expand Down

0 comments on commit 8577dbc

Please sign in to comment.