From 90fa28921ab5ad117d38efcbfca643b2083366d9 Mon Sep 17 00:00:00 2001 From: Lorenzo Gentile Date: Thu, 25 Jan 2024 16:09:39 +0100 Subject: [PATCH] EXP added new columns and perspectives --- Makefile | 5 ++++- exp/columns.lisp | 56 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5ee06580..7945c88b 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,8 @@ WCP := wcp/columns.lisp wcp/constraints.lisp \ MODEXP_DATA := modexpdata/ +EXP := exp/columns.lisp exp/constraints.lisp + ZKEVM_MODULES := ${ALU} \ ${BIN} \ ${EC_DATA} \ @@ -108,7 +110,8 @@ ZKEVM_MODULES := ${ALU} \ ${TABLES} \ ${TRM} \ ${TXN_DATA} \ - ${WCP} + ${WCP} \ + ${EXP} define.go: ${ZKEVM_MODULES} ${CORSET} wizard-iop -vv -P define -o $@ ${ZKEVM_MODULES} diff --git a/exp/columns.lisp b/exp/columns.lisp index 240026b3..ca9d94f8 100644 --- a/exp/columns.lisp +++ b/exp/columns.lisp @@ -2,8 +2,6 @@ (module exp) (defcolumns - STAMP - CT EXPNT_HI EXPNT_LO DYNCOST @@ -11,6 +9,58 @@ (BYTE :byte) ACC (PBIT :binary) - PACC) + PACC + ;; deprecated stuff above + (CMPTN :binary@prove) + (MACRO :binary@prove) + (PRPRC :binary@prove) + (STAMP :i32) + (CT :i4) + (CT_MAX :i4) + (IS_EXP_LOG :binary@prove) + (IS_MODEXP_LOG :binary@prove)) + +(defperspective computation + + ;; selector + CMPTN + + ;; computation-row columns + ((PLT_BIT :binary@prove) + (PLT_JUMP :i6) + (RAW_BYTE :byte@prove) + (RAW_ACC :i128) + (TRIM_BYTE :byte@prove) + (TRIM_ACC :i128) + (TANZB :binary@prove) + (TANZB_ACC :i5) + (MSNZB :byte@prove) + (BIT_MSNZB :binary@prove) + (ACC_MSNZB :byte@prove) + (MANZB :binary@prove) + (MANZB_ACC :i4))) + +(defperspective macro-instruction + + ;; selector + MACRO + + ;; macro-instruction-row columns + ((EXP_INST :byte@prove) + (DATA :i128 :array [5]))) + +(defperspective preprocessing + + ;; selector + PRPRC + + ;; preprocessing-row columns + ((WCP_FLAG :binary@prove) + (WCP_ARG_1_HI :i128) + (WCP_ARG_1_LO :i128) + (WCP_ARG_2_HI :i128) + (WCP_ARG_2_LO :i128) + (WCP_RES :binary@prove) + (WCP_INST :byte :display :opcode)))