From 3c7e5c81adf38d66da4dc91d722b0a08be05d6ee Mon Sep 17 00:00:00 2001 From: Balazs Komuves Date: Sun, 9 Feb 2025 11:59:01 +0100 Subject: [PATCH] update the lookup equations to reflect the changes in 091047f --- README.md | 2 +- src/Plonk/Lookups.hs | 2 +- src/testmain.hs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a262df9..e194ae9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ that the semantics we have to emulate, are _somewhat idiosyncratic_... - [x] Generating verifier challenges - [ ] Recursive circuit subtle details (like [this](https://github.com/0xPolygonZero/plonky2/blob/356aefb6863ac881fb71f9bf851582c915428458/plonky2/src/fri/challenges.rs#L55-L64])) - [x] Constraints check -- [ ] FRI check +- [x] FRI check - [x] Support lookup tables - [ ] Support zero-knowledge - [x] Documenting Plonky2 internals and the verifier algorithm (WIP) diff --git a/src/Plonk/Lookups.hs b/src/Plonk/Lookups.hs index bf0b480..4aadb91 100644 --- a/src/Plonk/Lookups.hs +++ b/src/Plonk/Lookups.hs @@ -104,7 +104,7 @@ evalLookupEquations (MkCommonCircuitData{..}) lkpSels openings challenges = fina lut = fromLookupTable table lut_nrows = length lut `divCeil` num_lut_slots -- number of rows in this table padded_size = lut_nrows * num_lut_slots -- padded size of the table - lut_padded = take padded_size $ lut ++ repeat (0,0) -- NOTE: this padding causes a soundness bug in Plonky2 + lut_padded = take padded_size $ lut ++ repeat (head lut) -- NOTE: the padding was fixed in commit 091047f cur_eval = foldl' (\acc x -> lookup_delta * acc + x) 0 [ (inp + lookup_B * out) | (inp,out) <- lut_padded ] diff --git a/src/testmain.hs b/src/testmain.hs index 69fbe47..a951a1d 100644 --- a/src/testmain.hs +++ b/src/testmain.hs @@ -24,9 +24,9 @@ import qualified Data.ByteString.Lazy.Char8 as L main = do -- let prefix = "fibonacci" -- let prefix = "lookup" - -- let prefix = "multi_lookup" + let prefix = "multi_lookup" -- let prefix = "recursion_middle" - let prefix = "recursion_outer" + -- let prefix = "recursion_outer" text_common <- L.readFile ("../json/" ++ prefix ++ "_common.json") text_vkey <- L.readFile ("../json/" ++ prefix ++ "_vkey.json" )