Skip to content

Commit

Permalink
Fix compiler to make tests pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Feb 10, 2024
1 parent bf281fd commit 702d0ea
Show file tree
Hide file tree
Showing 21 changed files with 1,347 additions and 1,148 deletions.
231 changes: 115 additions & 116 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/apis/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zk-regex-apis"
version = "1.1.6"
version = "1.1.7"
license = "MIT"
edition = "2018"
exclude = ["index.node"]
Expand All @@ -17,7 +17,7 @@ crate-type = ["rlib", "cdylib"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
zk-regex-compiler = { path = "../compiler"}
zk-regex-compiler = { path = "../compiler", default-features = false }
fancy-regex = "0.11.0"
itertools = "0.10.3"
thiserror = "1.0.40"
Expand Down
4 changes: 2 additions & 2 deletions packages/apis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zk-email/zk-regex-apis",
"version": "1.1.6",
"version": "1.1.7",
"description": "apis compatible with [zk-regex](https://github.com/zkemail/zk-regex/tree/main).",
"contributors": [
"Javier Su <javier.su.weijie@gmail.com>",
Expand Down Expand Up @@ -36,4 +36,4 @@
"package_name": "apis-{node_abi}-{platform}-{arch}.tar.gz",
"module_path": "./"
}
}
}
2 changes: 2 additions & 0 deletions packages/circom/circuits/common/body_hash_regex.circom
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pragma circom 2.1.5;

include "@zk-email/zk-regex-circom/circuits/regex_helpers.circom";

// regex: ((\n)|^)dkim-signature:((a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)+=[^;]+; )+bh=(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|\+|/|=)+;
template BodyHashRegex(msg_bytes) {
signal input msg[msg_bytes];
signal output out;
Expand Down Expand Up @@ -503,6 +504,7 @@ template BodyHashRegex(msg_bytes) {
is_consecutive[msg_bytes-1-i][0] <== states[num_bytes-i][8] * (1 - is_consecutive[msg_bytes-i][1]) + is_consecutive[msg_bytes-i][1];
is_consecutive[msg_bytes-1-i][1] <== state_changed[msg_bytes-i].out * is_consecutive[msg_bytes-1-i][0];
}
// substrings calculated: [{(5, 5), (3, 5)}]
signal is_substr0[msg_bytes][3];
signal is_reveal0[msg_bytes];
signal output reveal0[msg_bytes];
Expand Down
2 changes: 1 addition & 1 deletion packages/circom/circuits/common/email_addr_regex.circom
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ template EmailAddrRegex(msg_bytes) {
is_consecutive[msg_bytes-1-i][0] <== states[num_bytes-i][3] * (1 - is_consecutive[msg_bytes-i][1]) + is_consecutive[msg_bytes-i][1];
is_consecutive[msg_bytes-1-i][1] <== state_changed[msg_bytes-i].out * is_consecutive[msg_bytes-1-i][0];
}
// substrings calculated: [{(1, 2), (1, 1), (0, 1), (3, 3), (2, 3)}]
// substrings calculated: [{(1, 1), (0, 1), (3, 3), (1, 2), (2, 3)}]
signal is_substr0[msg_bytes][6];
signal is_reveal0[msg_bytes];
signal output reveal0[msg_bytes];
Expand Down
Loading

0 comments on commit 702d0ea

Please sign in to comment.