Skip to content

Commit

Permalink
const
Browse files Browse the repository at this point in the history
  • Loading branch information
echatav committed Sep 18, 2024
1 parent f8c5d1a commit 813cb56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ toVar ::
toVar witness = runHash @(Just (Order a)) $ witness $ \case
SysVar (InVar inV) -> merkleHash inV
SysVar (NewVar newV) -> M newV
ConstVar cV -> merkleHash cV
ConstVar cV -> fromConstant cV

----------------------------- Evaluation functions -----------------------------

Expand Down
4 changes: 2 additions & 2 deletions src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ZkFold.Base.Data.ByteString (toByteString)

newtype MerkleHash (n :: Maybe Natural) = M { runHash :: ByteString }

data Prec = Add | Mul | Div | Mod | Exp deriving (Generic, Binary)
data Prec = Add | Mul | Div | Mod | Exp | Const deriving (Generic, Binary)

merkleHash :: Binary a => a -> MerkleHash n
merkleHash = M . hash . toByteString
Expand All @@ -34,7 +34,7 @@ instance {-# OVERLAPPING #-} FromConstant (MerkleHash n) (MerkleHash n)
instance {-# OVERLAPPING #-} Scale (MerkleHash n) (MerkleHash n)

instance Binary a => FromConstant a (MerkleHash n) where
fromConstant = merkleHash
fromConstant x = merkleHash (Const, x)

instance Binary a => Scale a (MerkleHash n)

Expand Down

0 comments on commit 813cb56

Please sign in to comment.