Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Sora: Feat/integrate halo2 regex #17

Merged
merged 9 commits into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 18
- name: "Setup Rust"
uses: ATiltedTree/setup-rust@v1
with:
rust-version: nightly
components: clippy
- name: Download circom
run: wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 -O /usr/local/bin/circom
- name: Update permission
Expand All @@ -23,7 +27,7 @@ jobs:
run: yarn
# - name: Create build folder
# run: mkdir build
- name: Run Linters
run: yarn lint
# - name: Run Linters
# run: yarn lint
- name: Run tests
run: yarn test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ dist
.vscode
build/*
!build/.placeholder

target

index.node
Cargo.lock
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]
members = ["packages/*"]
exclude = ["packages/circom", "test"]

# [patch."https://github.com/stalwartlabs/mail-builder"]
# mail-builder = { version = "0.2.5", git = "https://github.com/stalwartlabs//mail-builder", tag = "0.2.5" }

# [patch."https://github.com/stalwartlabs/mail-parser"]
# mail-parser = { version = "0.8", git = "https://github.com/stalwartlabs//mail-parser", tag = "0.8.0" }
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# zk-regex

A library to do regex verification in circom, adapted from the original zk-email. Also spits out a halo2 lookup table for [halo2-regex](https://github.com/zkemail/halo2-regex) parsing. Note that you need to add valid accept states and substring definitions yourself. Releasing a tool to do this soon.
A library to do regex verification in circom and [halo2-regex](https://github.com/zkemail/halo2-regex).

We've forked [min-dfa into a UI here](https://mindfa.onrender.com/min_dfa) to create a UI that converts existing regexes with [] support, as well as escapes \_, and the character classes a-z, A-Z, and 0-9. It also shows the DFA states very clearly so you can choose accept states easily. This should make converting regexes into DFA form way cleaner.
<!-- We've forked [min-dfa into a UI here](https://mindfa.onrender.com/min_dfa) to create a UI that converts existing regexes with [] support, as well as escapes \_, and the character classes a-z, A-Z, and 0-9. It also shows the DFA states very clearly so you can choose accept states easily. This should make converting regexes into DFA form way cleaner. -->

## introduction
## Introduction

The compilation command generates a circom file at build/compiled.circom. This code is a JS adaptation of the Python regex-to-circom work done by [sampriti](https://github.com/sampritipanda/) and [yush_g](https://twitter.com/yush_g) at https://github.com/zk-email-verify/zk-email-verify/tree/main/regex_to_circom.

Expand Down
11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
['@babel/preset-react', { "runtime": "automatic" }],
['jest']
],
plugins: [
'@babel/plugin-transform-modules-commonjs',
]
};
Empty file removed build/.placeholder
Empty file.
48 changes: 0 additions & 48 deletions circuits/regex_helpers.circom

This file was deleted.

27 changes: 0 additions & 27 deletions compiler/cli.js

This file was deleted.

Loading
Loading