diff --git a/packages/circuits/package.json b/packages/circuits/package.json index cedc461..3d9a45c 100644 --- a/packages/circuits/package.json +++ b/packages/circuits/package.json @@ -13,7 +13,7 @@ "dependencies": { "@zk-email/circuits": "=6.3.2", "@zk-email/relayer-utils": "=0.4.59", - "@zk-email/zk-regex-circom": "=2.3.1", + "@zk-email/zk-regex-circom": "=2.3.2", "commander": "^12.1.0", "snarkjs": "=0.7.5" }, diff --git a/packages/circuits/src/regexes/command.json b/packages/circuits/src/regexes/command.json index 51291e1..1c70eb8 100644 --- a/packages/circuits/src/regexes/command.json +++ b/packages/circuits/src/regexes/command.json @@ -2,15 +2,15 @@ "parts": [ { "is_public": false, - "regex_def": "(
]*>)" + "regex_def": "\\[zkemail-begin\\]" }, { "is_public": true, - "regex_def": "[^<>/]+" + "regex_def": "[^<>/\\[\\]]+" }, { "is_public": false, - "regex_def": "
" + "regex_def": "\\[zkemail-end\\]" } ] } \ No newline at end of file diff --git a/packages/circuits/src/regexes/command_regex.circom b/packages/circuits/src/regexes/command_regex.circom index e29a26f..c9ea653 100644 --- a/packages/circuits/src/regexes/command_regex.circom +++ b/packages/circuits/src/regexes/command_regex.circom @@ -2,7 +2,7 @@ pragma circom 2.1.5; include "@zk-email/zk-regex-circom/circuits/regex_helpers.circom"; -// regex: (
]*>)[^<>/]+
+// regex: \[zkemail-begin\][^<>/\[\]]+\[zkemail-end\] template CommandRegex(msg_bytes) { signal input msg[msg_bytes]; signal output out; @@ -17,1250 +17,565 @@ template CommandRegex(msg_bytes) { in[i+1] <== msg[i]; } - component eq[82][num_bytes]; - component lt[38][num_bytes]; - component and[167][num_bytes]; - component multi_or[36][num_bytes]; - signal states[num_bytes+1][56]; - signal states_tmp[num_bytes+1][56]; + component eq[65][num_bytes]; + component lt[16][num_bytes]; + component and[59][num_bytes]; + component multi_or[12][num_bytes]; + signal states[num_bytes+1][37]; + signal states_tmp[num_bytes+1][37]; signal from_zero_enabled[num_bytes+1]; from_zero_enabled[num_bytes] <== 0; component state_changed[num_bytes]; - for (var i = 1; i < 56; i++) { + for (var i = 1; i < 37; i++) { states[0][i] <== 0; } for (var i = 0; i < num_bytes; i++) { - state_changed[i] = MultiOR(55); + state_changed[i] = MultiOR(36); states[i][0] <== 1; eq[0][i] = IsEqual(); eq[0][i].in[0] <== in[i]; - eq[0][i].in[1] <== 60; + eq[0][i].in[1] <== 91; and[0][i] = AND(); and[0][i].a <== states[i][0]; and[0][i].b <== eq[0][i].out; states_tmp[i+1][1] <== 0; eq[1][i] = IsEqual(); eq[1][i].in[0] <== in[i]; - eq[1][i].in[1] <== 100; + eq[1][i].in[1] <== 122; and[1][i] = AND(); and[1][i].a <== states[i][1]; and[1][i].b <== eq[1][i].out; states[i+1][2] <== and[1][i].out; eq[2][i] = IsEqual(); eq[2][i].in[0] <== in[i]; - eq[2][i].in[1] <== 105; + eq[2][i].in[1] <== 107; and[2][i] = AND(); and[2][i].a <== states[i][2]; and[2][i].b <== eq[2][i].out; states[i+1][3] <== and[2][i].out; eq[3][i] = IsEqual(); eq[3][i].in[0] <== in[i]; - eq[3][i].in[1] <== 118; + eq[3][i].in[1] <== 101; and[3][i] = AND(); and[3][i].a <== states[i][3]; and[3][i].b <== eq[3][i].out; states[i+1][4] <== and[3][i].out; eq[4][i] = IsEqual(); eq[4][i].in[0] <== in[i]; - eq[4][i].in[1] <== 32; + eq[4][i].in[1] <== 109; and[4][i] = AND(); and[4][i].a <== states[i][4]; and[4][i].b <== eq[4][i].out; states[i+1][5] <== and[4][i].out; + eq[5][i] = IsEqual(); + eq[5][i].in[0] <== in[i]; + eq[5][i].in[1] <== 97; and[5][i] = AND(); and[5][i].a <== states[i][5]; - and[5][i].b <== eq[2][i].out; + and[5][i].b <== eq[5][i].out; states[i+1][6] <== and[5][i].out; + eq[6][i] = IsEqual(); + eq[6][i].in[0] <== in[i]; + eq[6][i].in[1] <== 105; and[6][i] = AND(); and[6][i].a <== states[i][6]; - and[6][i].b <== eq[1][i].out; + and[6][i].b <== eq[6][i].out; states[i+1][7] <== and[6][i].out; - eq[5][i] = IsEqual(); - eq[5][i].in[0] <== in[i]; - eq[5][i].in[1] <== 61; + eq[7][i] = IsEqual(); + eq[7][i].in[0] <== in[i]; + eq[7][i].in[1] <== 108; and[7][i] = AND(); and[7][i].a <== states[i][7]; - and[7][i].b <== eq[5][i].out; + and[7][i].b <== eq[7][i].out; states[i+1][8] <== and[7][i].out; - eq[6][i] = IsEqual(); - eq[6][i].in[0] <== in[i]; - eq[6][i].in[1] <== 51; + eq[8][i] = IsEqual(); + eq[8][i].in[0] <== in[i]; + eq[8][i].in[1] <== 45; and[8][i] = AND(); and[8][i].a <== states[i][8]; - and[8][i].b <== eq[6][i].out; + and[8][i].b <== eq[8][i].out; states[i+1][9] <== and[8][i].out; - eq[7][i] = IsEqual(); - eq[7][i].in[0] <== in[i]; - eq[7][i].in[1] <== 68; + eq[9][i] = IsEqual(); + eq[9][i].in[0] <== in[i]; + eq[9][i].in[1] <== 98; and[9][i] = AND(); and[9][i].a <== states[i][9]; - and[9][i].b <== eq[7][i].out; + and[9][i].b <== eq[9][i].out; states[i+1][10] <== and[9][i].out; - eq[8][i] = IsEqual(); - eq[8][i].in[0] <== in[i]; - eq[8][i].in[1] <== 34; and[10][i] = AND(); and[10][i].a <== states[i][10]; - and[10][i].b <== eq[8][i].out; + and[10][i].b <== eq[3][i].out; + states[i+1][11] <== and[10][i].out; + eq[10][i] = IsEqual(); + eq[10][i].in[0] <== in[i]; + eq[10][i].in[1] <== 103; + and[11][i] = AND(); + and[11][i].a <== states[i][11]; + and[11][i].b <== eq[10][i].out; + states[i+1][12] <== and[11][i].out; + and[12][i] = AND(); + and[12][i].a <== states[i][12]; + and[12][i].b <== eq[6][i].out; + states[i+1][13] <== and[12][i].out; + eq[11][i] = IsEqual(); + eq[11][i].in[0] <== in[i]; + eq[11][i].in[1] <== 110; + and[13][i] = AND(); + and[13][i].a <== states[i][13]; + and[13][i].b <== eq[11][i].out; + states[i+1][14] <== and[13][i].out; + eq[12][i] = IsEqual(); + eq[12][i].in[0] <== in[i]; + eq[12][i].in[1] <== 93; + and[14][i] = AND(); + and[14][i].a <== states[i][14]; + and[14][i].b <== eq[12][i].out; + states[i+1][15] <== and[14][i].out; lt[0][i] = LessEqThan(8); lt[0][i].in[0] <== 1; lt[0][i].in[1] <== in[i]; lt[1][i] = LessEqThan(8); lt[1][i].in[0] <== in[i]; - lt[1][i].in[1] <== 33; - and[11][i] = AND(); - and[11][i].a <== lt[0][i].out; - and[11][i].b <== lt[1][i].out; + lt[1][i].in[1] <== 46; + and[15][i] = AND(); + and[15][i].a <== lt[0][i].out; + and[15][i].b <== lt[1][i].out; lt[2][i] = LessEqThan(8); - lt[2][i].in[0] <== 35; + lt[2][i].in[0] <== 63; lt[2][i].in[1] <== in[i]; lt[3][i] = LessEqThan(8); lt[3][i].in[0] <== in[i]; - lt[3][i].in[1] <== 121; - and[12][i] = AND(); - and[12][i].a <== lt[2][i].out; - and[12][i].b <== lt[3][i].out; - eq[9][i] = IsEqual(); - eq[9][i].in[0] <== in[i]; - eq[9][i].in[1] <== 123; - eq[10][i] = IsEqual(); - eq[10][i].in[0] <== in[i]; - eq[10][i].in[1] <== 124; - eq[11][i] = IsEqual(); - eq[11][i].in[0] <== in[i]; - eq[11][i].in[1] <== 125; - eq[12][i] = IsEqual(); - eq[12][i].in[0] <== in[i]; - eq[12][i].in[1] <== 126; - eq[13][i] = IsEqual(); - eq[13][i].in[0] <== in[i]; - eq[13][i].in[1] <== 127; - and[13][i] = AND(); - and[13][i].a <== states[i][11]; - multi_or[0][i] = MultiOR(7); - multi_or[0][i].in[0] <== and[11][i].out; - multi_or[0][i].in[1] <== and[12][i].out; - multi_or[0][i].in[2] <== eq[9][i].out; - multi_or[0][i].in[3] <== eq[10][i].out; - multi_or[0][i].in[4] <== eq[11][i].out; - multi_or[0][i].in[5] <== eq[12][i].out; - multi_or[0][i].in[6] <== eq[13][i].out; - and[13][i].b <== multi_or[0][i].out; + lt[3][i].in[1] <== 90; + and[16][i] = AND(); + and[16][i].a <== lt[2][i].out; + and[16][i].b <== lt[3][i].out; lt[4][i] = LessEqThan(8); - lt[4][i].in[0] <== 128; + lt[4][i].in[0] <== 94; lt[4][i].in[1] <== in[i]; lt[5][i] = LessEqThan(8); lt[5][i].in[0] <== in[i]; - lt[5][i].in[1] <== 191; - and[14][i] = AND(); - and[14][i].a <== lt[4][i].out; - and[14][i].b <== lt[5][i].out; - and[15][i] = AND(); - and[15][i].a <== states[i][12]; - and[15][i].b <== and[14][i].out; - lt[6][i] = LessEqThan(8); - lt[6][i].in[0] <== 35; - lt[6][i].in[1] <== in[i]; - lt[7][i] = LessEqThan(8); - lt[7][i].in[0] <== in[i]; - lt[7][i].in[1] <== 106; - and[16][i] = AND(); - and[16][i].a <== lt[6][i].out; - and[16][i].b <== lt[7][i].out; + lt[5][i].in[1] <== 127; + and[17][i] = AND(); + and[17][i].a <== lt[4][i].out; + and[17][i].b <== lt[5][i].out; + eq[13][i] = IsEqual(); + eq[13][i].in[0] <== in[i]; + eq[13][i].in[1] <== 48; eq[14][i] = IsEqual(); eq[14][i].in[0] <== in[i]; - eq[14][i].in[1] <== 108; + eq[14][i].in[1] <== 49; eq[15][i] = IsEqual(); eq[15][i].in[0] <== in[i]; - eq[15][i].in[1] <== 109; + eq[15][i].in[1] <== 50; eq[16][i] = IsEqual(); eq[16][i].in[0] <== in[i]; - eq[16][i].in[1] <== 110; + eq[16][i].in[1] <== 51; eq[17][i] = IsEqual(); eq[17][i].in[0] <== in[i]; - eq[17][i].in[1] <== 111; + eq[17][i].in[1] <== 52; eq[18][i] = IsEqual(); eq[18][i].in[0] <== in[i]; - eq[18][i].in[1] <== 112; + eq[18][i].in[1] <== 53; eq[19][i] = IsEqual(); eq[19][i].in[0] <== in[i]; - eq[19][i].in[1] <== 113; + eq[19][i].in[1] <== 54; eq[20][i] = IsEqual(); eq[20][i].in[0] <== in[i]; - eq[20][i].in[1] <== 114; + eq[20][i].in[1] <== 55; eq[21][i] = IsEqual(); eq[21][i].in[0] <== in[i]; - eq[21][i].in[1] <== 115; + eq[21][i].in[1] <== 56; eq[22][i] = IsEqual(); eq[22][i].in[0] <== in[i]; - eq[22][i].in[1] <== 116; + eq[22][i].in[1] <== 57; eq[23][i] = IsEqual(); eq[23][i].in[0] <== in[i]; - eq[23][i].in[1] <== 117; + eq[23][i].in[1] <== 58; eq[24][i] = IsEqual(); eq[24][i].in[0] <== in[i]; - eq[24][i].in[1] <== 119; + eq[24][i].in[1] <== 59; eq[25][i] = IsEqual(); eq[25][i].in[0] <== in[i]; - eq[25][i].in[1] <== 120; + eq[25][i].in[1] <== 61; eq[26][i] = IsEqual(); eq[26][i].in[0] <== in[i]; - eq[26][i].in[1] <== 121; - and[17][i] = AND(); - and[17][i].a <== states[i][19]; - multi_or[1][i] = MultiOR(21); - multi_or[1][i].in[0] <== and[11][i].out; - multi_or[1][i].in[1] <== and[16][i].out; - multi_or[1][i].in[2] <== eq[14][i].out; - multi_or[1][i].in[3] <== eq[15][i].out; - multi_or[1][i].in[4] <== eq[16][i].out; - multi_or[1][i].in[5] <== eq[17][i].out; - multi_or[1][i].in[6] <== eq[18][i].out; - multi_or[1][i].in[7] <== eq[19][i].out; - multi_or[1][i].in[8] <== eq[20][i].out; - multi_or[1][i].in[9] <== eq[21][i].out; - multi_or[1][i].in[10] <== eq[22][i].out; - multi_or[1][i].in[11] <== eq[23][i].out; - multi_or[1][i].in[12] <== eq[3][i].out; - multi_or[1][i].in[13] <== eq[24][i].out; - multi_or[1][i].in[14] <== eq[25][i].out; - multi_or[1][i].in[15] <== eq[26][i].out; - multi_or[1][i].in[16] <== eq[9][i].out; - multi_or[1][i].in[17] <== eq[10][i].out; - multi_or[1][i].in[18] <== eq[11][i].out; - multi_or[1][i].in[19] <== eq[12][i].out; - multi_or[1][i].in[20] <== eq[13][i].out; - and[17][i].b <== multi_or[1][i].out; + eq[26][i].in[1] <== 92; + and[18][i] = AND(); + and[18][i].a <== states[i][15]; + multi_or[0][i] = MultiOR(17); + multi_or[0][i].in[0] <== and[15][i].out; + multi_or[0][i].in[1] <== and[16][i].out; + multi_or[0][i].in[2] <== and[17][i].out; + multi_or[0][i].in[3] <== eq[13][i].out; + multi_or[0][i].in[4] <== eq[14][i].out; + multi_or[0][i].in[5] <== eq[15][i].out; + multi_or[0][i].in[6] <== eq[16][i].out; + multi_or[0][i].in[7] <== eq[17][i].out; + multi_or[0][i].in[8] <== eq[18][i].out; + multi_or[0][i].in[9] <== eq[19][i].out; + multi_or[0][i].in[10] <== eq[20][i].out; + multi_or[0][i].in[11] <== eq[21][i].out; + multi_or[0][i].in[12] <== eq[22][i].out; + multi_or[0][i].in[13] <== eq[23][i].out; + multi_or[0][i].in[14] <== eq[24][i].out; + multi_or[0][i].in[15] <== eq[25][i].out; + multi_or[0][i].in[16] <== eq[26][i].out; + and[18][i].b <== multi_or[0][i].out; + and[19][i] = AND(); + and[19][i].a <== states[i][16]; + and[19][i].b <== multi_or[0][i].out; + lt[6][i] = LessEqThan(8); + lt[6][i].in[0] <== 128; + lt[6][i].in[1] <== in[i]; + lt[7][i] = LessEqThan(8); + lt[7][i].in[0] <== in[i]; + lt[7][i].in[1] <== 191; + and[20][i] = AND(); + and[20][i].a <== lt[6][i].out; + and[20][i].b <== lt[7][i].out; + and[21][i] = AND(); + and[21][i].a <== states[i][17]; + and[21][i].b <== and[20][i].out; + multi_or[1][i] = MultiOR(3); + multi_or[1][i].in[0] <== and[18][i].out; + multi_or[1][i].in[1] <== and[19][i].out; + multi_or[1][i].in[2] <== and[21][i].out; + states[i+1][16] <== multi_or[1][i].out; lt[8][i] = LessEqThan(8); - lt[8][i].in[0] <== 35; + lt[8][i].in[0] <== 194; lt[8][i].in[1] <== in[i]; lt[9][i] = LessEqThan(8); lt[9][i].in[0] <== in[i]; - lt[9][i].in[1] <== 100; - and[18][i] = AND(); - and[18][i].a <== lt[8][i].out; - and[18][i].b <== lt[9][i].out; + lt[9][i].in[1] <== 223; + and[22][i] = AND(); + and[22][i].a <== lt[8][i].out; + and[22][i].b <== lt[9][i].out; + and[23][i] = AND(); + and[23][i].a <== states[i][15]; + and[23][i].b <== and[22][i].out; + and[24][i] = AND(); + and[24][i].a <== states[i][16]; + and[24][i].b <== and[22][i].out; lt[10][i] = LessEqThan(8); - lt[10][i].in[0] <== 102; + lt[10][i].in[0] <== 160; lt[10][i].in[1] <== in[i]; lt[11][i] = LessEqThan(8); lt[11][i].in[0] <== in[i]; - lt[11][i].in[1] <== 121; - and[19][i] = AND(); - and[19][i].a <== lt[10][i].out; - and[19][i].b <== lt[11][i].out; - and[20][i] = AND(); - and[20][i].a <== states[i][20]; - multi_or[2][i] = MultiOR(8); - multi_or[2][i].in[0] <== and[11][i].out; - multi_or[2][i].in[1] <== and[18][i].out; - multi_or[2][i].in[2] <== and[19][i].out; - multi_or[2][i].in[3] <== eq[9][i].out; - multi_or[2][i].in[4] <== eq[10][i].out; - multi_or[2][i].in[5] <== eq[11][i].out; - multi_or[2][i].in[6] <== eq[12][i].out; - multi_or[2][i].in[7] <== eq[13][i].out; - and[20][i].b <== multi_or[2][i].out; + lt[11][i].in[1] <== 191; + and[25][i] = AND(); + and[25][i].a <== lt[10][i].out; + and[25][i].b <== lt[11][i].out; + and[26][i] = AND(); + and[26][i].a <== states[i][18]; + and[26][i].b <== and[25][i].out; + and[27][i] = AND(); + and[27][i].a <== states[i][19]; + and[27][i].b <== and[20][i].out; lt[12][i] = LessEqThan(8); - lt[12][i].in[0] <== 35; + lt[12][i].in[0] <== 128; lt[12][i].in[1] <== in[i]; lt[13][i] = LessEqThan(8); lt[13][i].in[0] <== in[i]; - lt[13][i].in[1] <== 108; - and[21][i] = AND(); - and[21][i].a <== lt[12][i].out; - and[21][i].b <== lt[13][i].out; - and[22][i] = AND(); - and[22][i].a <== states[i][21]; - multi_or[3][i] = MultiOR(19); - multi_or[3][i].in[0] <== and[11][i].out; - multi_or[3][i].in[1] <== and[21][i].out; - multi_or[3][i].in[2] <== eq[16][i].out; - multi_or[3][i].in[3] <== eq[17][i].out; - multi_or[3][i].in[4] <== eq[18][i].out; - multi_or[3][i].in[5] <== eq[19][i].out; - multi_or[3][i].in[6] <== eq[20][i].out; - multi_or[3][i].in[7] <== eq[21][i].out; - multi_or[3][i].in[8] <== eq[22][i].out; - multi_or[3][i].in[9] <== eq[23][i].out; - multi_or[3][i].in[10] <== eq[3][i].out; - multi_or[3][i].in[11] <== eq[24][i].out; - multi_or[3][i].in[12] <== eq[25][i].out; - multi_or[3][i].in[13] <== eq[26][i].out; - multi_or[3][i].in[14] <== eq[9][i].out; - multi_or[3][i].in[15] <== eq[10][i].out; - multi_or[3][i].in[16] <== eq[11][i].out; - multi_or[3][i].in[17] <== eq[12][i].out; - multi_or[3][i].in[18] <== eq[13][i].out; - and[22][i].b <== multi_or[3][i].out; - lt[14][i] = LessEqThan(8); - lt[14][i].in[0] <== 35; - lt[14][i].in[1] <== in[i]; - lt[15][i] = LessEqThan(8); - lt[15][i].in[0] <== in[i]; - lt[15][i].in[1] <== 96; - and[23][i] = AND(); - and[23][i].a <== lt[14][i].out; - and[23][i].b <== lt[15][i].out; - lt[16][i] = LessEqThan(8); - lt[16][i].in[0] <== 98; - lt[16][i].in[1] <== in[i]; - lt[17][i] = LessEqThan(8); - lt[17][i].in[0] <== in[i]; - lt[17][i].in[1] <== 121; - and[24][i] = AND(); - and[24][i].a <== lt[16][i].out; - and[24][i].b <== lt[17][i].out; - and[25][i] = AND(); - and[25][i].a <== states[i][22]; - multi_or[4][i] = MultiOR(8); - multi_or[4][i].in[0] <== and[11][i].out; - multi_or[4][i].in[1] <== and[23][i].out; - multi_or[4][i].in[2] <== and[24][i].out; - multi_or[4][i].in[3] <== eq[9][i].out; - multi_or[4][i].in[4] <== eq[10][i].out; - multi_or[4][i].in[5] <== eq[11][i].out; - multi_or[4][i].in[6] <== eq[12][i].out; - multi_or[4][i].in[7] <== eq[13][i].out; - and[25][i].b <== multi_or[4][i].out; - lt[18][i] = LessEqThan(8); - lt[18][i].in[0] <== 35; - lt[18][i].in[1] <== in[i]; - lt[19][i] = LessEqThan(8); - lt[19][i].in[0] <== in[i]; - lt[19][i].in[1] <== 104; - and[26][i] = AND(); - and[26][i].a <== lt[18][i].out; - and[26][i].b <== lt[19][i].out; - eq[27][i] = IsEqual(); - eq[27][i].in[0] <== in[i]; - eq[27][i].in[1] <== 106; - eq[28][i] = IsEqual(); - eq[28][i].in[0] <== in[i]; - eq[28][i].in[1] <== 107; - and[27][i] = AND(); - and[27][i].a <== states[i][23]; - multi_or[5][i] = MultiOR(23); - multi_or[5][i].in[0] <== and[11][i].out; - multi_or[5][i].in[1] <== and[26][i].out; - multi_or[5][i].in[2] <== eq[27][i].out; - multi_or[5][i].in[3] <== eq[28][i].out; - multi_or[5][i].in[4] <== eq[14][i].out; - multi_or[5][i].in[5] <== eq[15][i].out; - multi_or[5][i].in[6] <== eq[16][i].out; - multi_or[5][i].in[7] <== eq[17][i].out; - multi_or[5][i].in[8] <== eq[18][i].out; - multi_or[5][i].in[9] <== eq[19][i].out; - multi_or[5][i].in[10] <== eq[20][i].out; - multi_or[5][i].in[11] <== eq[21][i].out; - multi_or[5][i].in[12] <== eq[22][i].out; - multi_or[5][i].in[13] <== eq[23][i].out; - multi_or[5][i].in[14] <== eq[3][i].out; - multi_or[5][i].in[15] <== eq[24][i].out; - multi_or[5][i].in[16] <== eq[25][i].out; - multi_or[5][i].in[17] <== eq[26][i].out; - multi_or[5][i].in[18] <== eq[9][i].out; - multi_or[5][i].in[19] <== eq[10][i].out; - multi_or[5][i].in[20] <== eq[11][i].out; - multi_or[5][i].in[21] <== eq[12][i].out; - multi_or[5][i].in[22] <== eq[13][i].out; - and[27][i].b <== multi_or[5][i].out; - lt[20][i] = LessEqThan(8); - lt[20][i].in[0] <== 35; - lt[20][i].in[1] <== in[i]; - lt[21][i] = LessEqThan(8); - lt[21][i].in[0] <== in[i]; - lt[21][i].in[1] <== 107; + lt[13][i].in[1] <== 159; and[28][i] = AND(); - and[28][i].a <== lt[20][i].out; - and[28][i].b <== lt[21][i].out; + and[28][i].a <== lt[12][i].out; + and[28][i].b <== lt[13][i].out; and[29][i] = AND(); - and[29][i].a <== states[i][24]; - multi_or[6][i] = MultiOR(20); - multi_or[6][i].in[0] <== and[11][i].out; - multi_or[6][i].in[1] <== and[28][i].out; - multi_or[6][i].in[2] <== eq[15][i].out; - multi_or[6][i].in[3] <== eq[16][i].out; - multi_or[6][i].in[4] <== eq[17][i].out; - multi_or[6][i].in[5] <== eq[18][i].out; - multi_or[6][i].in[6] <== eq[19][i].out; - multi_or[6][i].in[7] <== eq[20][i].out; - multi_or[6][i].in[8] <== eq[21][i].out; - multi_or[6][i].in[9] <== eq[22][i].out; - multi_or[6][i].in[10] <== eq[23][i].out; - multi_or[6][i].in[11] <== eq[3][i].out; - multi_or[6][i].in[12] <== eq[24][i].out; - multi_or[6][i].in[13] <== eq[25][i].out; - multi_or[6][i].in[14] <== eq[26][i].out; - multi_or[6][i].in[15] <== eq[9][i].out; - multi_or[6][i].in[16] <== eq[10][i].out; - multi_or[6][i].in[17] <== eq[11][i].out; - multi_or[6][i].in[18] <== eq[12][i].out; - multi_or[6][i].in[19] <== eq[13][i].out; - and[29][i].b <== multi_or[6][i].out; - multi_or[7][i] = MultiOR(9); - multi_or[7][i].in[0] <== and[10][i].out; - multi_or[7][i].in[1] <== and[13][i].out; - multi_or[7][i].in[2] <== and[15][i].out; - multi_or[7][i].in[3] <== and[17][i].out; - multi_or[7][i].in[4] <== and[20][i].out; - multi_or[7][i].in[5] <== and[22][i].out; - multi_or[7][i].in[6] <== and[25][i].out; - multi_or[7][i].in[7] <== and[27][i].out; - multi_or[7][i].in[8] <== and[29][i].out; - states[i+1][11] <== multi_or[7][i].out; - lt[22][i] = LessEqThan(8); - lt[22][i].in[0] <== 194; - lt[22][i].in[1] <== in[i]; - lt[23][i] = LessEqThan(8); - lt[23][i].in[0] <== in[i]; - lt[23][i].in[1] <== 223; + and[29][i].a <== states[i][20]; + and[29][i].b <== and[28][i].out; + multi_or[2][i] = MultiOR(5); + multi_or[2][i].in[0] <== and[23][i].out; + multi_or[2][i].in[1] <== and[24][i].out; + multi_or[2][i].in[2] <== and[26][i].out; + multi_or[2][i].in[3] <== and[27][i].out; + multi_or[2][i].in[4] <== and[29][i].out; + states[i+1][17] <== multi_or[2][i].out; + eq[27][i] = IsEqual(); + eq[27][i].in[0] <== in[i]; + eq[27][i].in[1] <== 224; and[30][i] = AND(); - and[30][i].a <== lt[22][i].out; - and[30][i].b <== lt[23][i].out; + and[30][i].a <== states[i][15]; + and[30][i].b <== eq[27][i].out; and[31][i] = AND(); - and[31][i].a <== states[i][11]; - and[31][i].b <== and[30][i].out; - lt[24][i] = LessEqThan(8); - lt[24][i].in[0] <== 160; - lt[24][i].in[1] <== in[i]; - lt[25][i] = LessEqThan(8); - lt[25][i].in[0] <== in[i]; - lt[25][i].in[1] <== 191; - and[32][i] = AND(); - and[32][i].a <== lt[24][i].out; - and[32][i].b <== lt[25][i].out; - and[33][i] = AND(); - and[33][i].a <== states[i][13]; - and[33][i].b <== and[32][i].out; - and[34][i] = AND(); - and[34][i].a <== states[i][14]; - and[34][i].b <== and[14][i].out; - lt[26][i] = LessEqThan(8); - lt[26][i].in[0] <== 128; - lt[26][i].in[1] <== in[i]; - lt[27][i] = LessEqThan(8); - lt[27][i].in[0] <== in[i]; - lt[27][i].in[1] <== 159; - and[35][i] = AND(); - and[35][i].a <== lt[26][i].out; - and[35][i].b <== lt[27][i].out; - and[36][i] = AND(); - and[36][i].a <== states[i][15]; - and[36][i].b <== and[35][i].out; - and[37][i] = AND(); - and[37][i].a <== states[i][19]; - and[37][i].b <== and[30][i].out; - and[38][i] = AND(); - and[38][i].a <== states[i][20]; - and[38][i].b <== and[30][i].out; - and[39][i] = AND(); - and[39][i].a <== states[i][21]; - and[39][i].b <== and[30][i].out; - and[40][i] = AND(); - and[40][i].a <== states[i][22]; - and[40][i].b <== and[30][i].out; - and[41][i] = AND(); - and[41][i].a <== states[i][23]; - and[41][i].b <== and[30][i].out; - and[42][i] = AND(); - and[42][i].a <== states[i][24]; - and[42][i].b <== and[30][i].out; - multi_or[8][i] = MultiOR(10); - multi_or[8][i].in[0] <== and[31][i].out; - multi_or[8][i].in[1] <== and[33][i].out; - multi_or[8][i].in[2] <== and[34][i].out; - multi_or[8][i].in[3] <== and[36][i].out; - multi_or[8][i].in[4] <== and[37][i].out; - multi_or[8][i].in[5] <== and[38][i].out; - multi_or[8][i].in[6] <== and[39][i].out; - multi_or[8][i].in[7] <== and[40][i].out; - multi_or[8][i].in[8] <== and[41][i].out; - multi_or[8][i].in[9] <== and[42][i].out; - states[i+1][12] <== multi_or[8][i].out; + and[31][i].a <== states[i][16]; + and[31][i].b <== eq[27][i].out; + multi_or[3][i] = MultiOR(2); + multi_or[3][i].in[0] <== and[30][i].out; + multi_or[3][i].in[1] <== and[31][i].out; + states[i+1][18] <== multi_or[3][i].out; + eq[28][i] = IsEqual(); + eq[28][i].in[0] <== in[i]; + eq[28][i].in[1] <== 225; eq[29][i] = IsEqual(); eq[29][i].in[0] <== in[i]; - eq[29][i].in[1] <== 224; - and[43][i] = AND(); - and[43][i].a <== states[i][11]; - and[43][i].b <== eq[29][i].out; - and[44][i] = AND(); - and[44][i].a <== states[i][19]; - and[44][i].b <== eq[29][i].out; - and[45][i] = AND(); - and[45][i].a <== states[i][20]; - and[45][i].b <== eq[29][i].out; - and[46][i] = AND(); - and[46][i].a <== states[i][21]; - and[46][i].b <== eq[29][i].out; - and[47][i] = AND(); - and[47][i].a <== states[i][22]; - and[47][i].b <== eq[29][i].out; - and[48][i] = AND(); - and[48][i].a <== states[i][23]; - and[48][i].b <== eq[29][i].out; - and[49][i] = AND(); - and[49][i].a <== states[i][24]; - and[49][i].b <== eq[29][i].out; - multi_or[9][i] = MultiOR(7); - multi_or[9][i].in[0] <== and[43][i].out; - multi_or[9][i].in[1] <== and[44][i].out; - multi_or[9][i].in[2] <== and[45][i].out; - multi_or[9][i].in[3] <== and[46][i].out; - multi_or[9][i].in[4] <== and[47][i].out; - multi_or[9][i].in[5] <== and[48][i].out; - multi_or[9][i].in[6] <== and[49][i].out; - states[i+1][13] <== multi_or[9][i].out; + eq[29][i].in[1] <== 226; eq[30][i] = IsEqual(); eq[30][i].in[0] <== in[i]; - eq[30][i].in[1] <== 225; + eq[30][i].in[1] <== 227; eq[31][i] = IsEqual(); eq[31][i].in[0] <== in[i]; - eq[31][i].in[1] <== 226; + eq[31][i].in[1] <== 228; eq[32][i] = IsEqual(); eq[32][i].in[0] <== in[i]; - eq[32][i].in[1] <== 227; + eq[32][i].in[1] <== 229; eq[33][i] = IsEqual(); eq[33][i].in[0] <== in[i]; - eq[33][i].in[1] <== 228; + eq[33][i].in[1] <== 230; eq[34][i] = IsEqual(); eq[34][i].in[0] <== in[i]; - eq[34][i].in[1] <== 229; + eq[34][i].in[1] <== 231; eq[35][i] = IsEqual(); eq[35][i].in[0] <== in[i]; - eq[35][i].in[1] <== 230; + eq[35][i].in[1] <== 232; eq[36][i] = IsEqual(); eq[36][i].in[0] <== in[i]; - eq[36][i].in[1] <== 231; + eq[36][i].in[1] <== 233; eq[37][i] = IsEqual(); eq[37][i].in[0] <== in[i]; - eq[37][i].in[1] <== 232; + eq[37][i].in[1] <== 234; eq[38][i] = IsEqual(); eq[38][i].in[0] <== in[i]; - eq[38][i].in[1] <== 233; + eq[38][i].in[1] <== 235; eq[39][i] = IsEqual(); eq[39][i].in[0] <== in[i]; - eq[39][i].in[1] <== 234; + eq[39][i].in[1] <== 236; eq[40][i] = IsEqual(); eq[40][i].in[0] <== in[i]; - eq[40][i].in[1] <== 235; + eq[40][i].in[1] <== 238; eq[41][i] = IsEqual(); eq[41][i].in[0] <== in[i]; - eq[41][i].in[1] <== 236; + eq[41][i].in[1] <== 239; + and[32][i] = AND(); + and[32][i].a <== states[i][15]; + multi_or[4][i] = MultiOR(14); + multi_or[4][i].in[0] <== eq[28][i].out; + multi_or[4][i].in[1] <== eq[29][i].out; + multi_or[4][i].in[2] <== eq[30][i].out; + multi_or[4][i].in[3] <== eq[31][i].out; + multi_or[4][i].in[4] <== eq[32][i].out; + multi_or[4][i].in[5] <== eq[33][i].out; + multi_or[4][i].in[6] <== eq[34][i].out; + multi_or[4][i].in[7] <== eq[35][i].out; + multi_or[4][i].in[8] <== eq[36][i].out; + multi_or[4][i].in[9] <== eq[37][i].out; + multi_or[4][i].in[10] <== eq[38][i].out; + multi_or[4][i].in[11] <== eq[39][i].out; + multi_or[4][i].in[12] <== eq[40][i].out; + multi_or[4][i].in[13] <== eq[41][i].out; + and[32][i].b <== multi_or[4][i].out; + and[33][i] = AND(); + and[33][i].a <== states[i][16]; + and[33][i].b <== multi_or[4][i].out; + lt[14][i] = LessEqThan(8); + lt[14][i].in[0] <== 144; + lt[14][i].in[1] <== in[i]; + lt[15][i] = LessEqThan(8); + lt[15][i].in[0] <== in[i]; + lt[15][i].in[1] <== 191; + and[34][i] = AND(); + and[34][i].a <== lt[14][i].out; + and[34][i].b <== lt[15][i].out; + and[35][i] = AND(); + and[35][i].a <== states[i][21]; + and[35][i].b <== and[34][i].out; + and[36][i] = AND(); + and[36][i].a <== states[i][22]; + and[36][i].b <== and[20][i].out; eq[42][i] = IsEqual(); eq[42][i].in[0] <== in[i]; - eq[42][i].in[1] <== 238; + eq[42][i].in[1] <== 128; eq[43][i] = IsEqual(); eq[43][i].in[0] <== in[i]; - eq[43][i].in[1] <== 239; - and[50][i] = AND(); - and[50][i].a <== states[i][11]; - multi_or[10][i] = MultiOR(14); - multi_or[10][i].in[0] <== eq[30][i].out; - multi_or[10][i].in[1] <== eq[31][i].out; - multi_or[10][i].in[2] <== eq[32][i].out; - multi_or[10][i].in[3] <== eq[33][i].out; - multi_or[10][i].in[4] <== eq[34][i].out; - multi_or[10][i].in[5] <== eq[35][i].out; - multi_or[10][i].in[6] <== eq[36][i].out; - multi_or[10][i].in[7] <== eq[37][i].out; - multi_or[10][i].in[8] <== eq[38][i].out; - multi_or[10][i].in[9] <== eq[39][i].out; - multi_or[10][i].in[10] <== eq[40][i].out; - multi_or[10][i].in[11] <== eq[41][i].out; - multi_or[10][i].in[12] <== eq[42][i].out; - multi_or[10][i].in[13] <== eq[43][i].out; - and[50][i].b <== multi_or[10][i].out; - lt[28][i] = LessEqThan(8); - lt[28][i].in[0] <== 144; - lt[28][i].in[1] <== in[i]; - lt[29][i] = LessEqThan(8); - lt[29][i].in[0] <== in[i]; - lt[29][i].in[1] <== 191; - and[51][i] = AND(); - and[51][i].a <== lt[28][i].out; - and[51][i].b <== lt[29][i].out; - and[52][i] = AND(); - and[52][i].a <== states[i][16]; - and[52][i].b <== and[51][i].out; - and[53][i] = AND(); - and[53][i].a <== states[i][17]; - and[53][i].b <== and[14][i].out; + eq[43][i].in[1] <== 129; eq[44][i] = IsEqual(); eq[44][i].in[0] <== in[i]; - eq[44][i].in[1] <== 128; + eq[44][i].in[1] <== 130; eq[45][i] = IsEqual(); eq[45][i].in[0] <== in[i]; - eq[45][i].in[1] <== 129; + eq[45][i].in[1] <== 131; eq[46][i] = IsEqual(); eq[46][i].in[0] <== in[i]; - eq[46][i].in[1] <== 130; + eq[46][i].in[1] <== 132; eq[47][i] = IsEqual(); eq[47][i].in[0] <== in[i]; - eq[47][i].in[1] <== 131; + eq[47][i].in[1] <== 133; eq[48][i] = IsEqual(); eq[48][i].in[0] <== in[i]; - eq[48][i].in[1] <== 132; + eq[48][i].in[1] <== 134; eq[49][i] = IsEqual(); eq[49][i].in[0] <== in[i]; - eq[49][i].in[1] <== 133; + eq[49][i].in[1] <== 135; eq[50][i] = IsEqual(); eq[50][i].in[0] <== in[i]; - eq[50][i].in[1] <== 134; + eq[50][i].in[1] <== 136; eq[51][i] = IsEqual(); eq[51][i].in[0] <== in[i]; - eq[51][i].in[1] <== 135; + eq[51][i].in[1] <== 137; eq[52][i] = IsEqual(); eq[52][i].in[0] <== in[i]; - eq[52][i].in[1] <== 136; + eq[52][i].in[1] <== 138; eq[53][i] = IsEqual(); eq[53][i].in[0] <== in[i]; - eq[53][i].in[1] <== 137; + eq[53][i].in[1] <== 139; eq[54][i] = IsEqual(); eq[54][i].in[0] <== in[i]; - eq[54][i].in[1] <== 138; + eq[54][i].in[1] <== 140; eq[55][i] = IsEqual(); eq[55][i].in[0] <== in[i]; - eq[55][i].in[1] <== 139; + eq[55][i].in[1] <== 141; eq[56][i] = IsEqual(); eq[56][i].in[0] <== in[i]; - eq[56][i].in[1] <== 140; + eq[56][i].in[1] <== 142; eq[57][i] = IsEqual(); eq[57][i].in[0] <== in[i]; - eq[57][i].in[1] <== 141; + eq[57][i].in[1] <== 143; + and[37][i] = AND(); + and[37][i].a <== states[i][23]; + multi_or[5][i] = MultiOR(16); + multi_or[5][i].in[0] <== eq[42][i].out; + multi_or[5][i].in[1] <== eq[43][i].out; + multi_or[5][i].in[2] <== eq[44][i].out; + multi_or[5][i].in[3] <== eq[45][i].out; + multi_or[5][i].in[4] <== eq[46][i].out; + multi_or[5][i].in[5] <== eq[47][i].out; + multi_or[5][i].in[6] <== eq[48][i].out; + multi_or[5][i].in[7] <== eq[49][i].out; + multi_or[5][i].in[8] <== eq[50][i].out; + multi_or[5][i].in[9] <== eq[51][i].out; + multi_or[5][i].in[10] <== eq[52][i].out; + multi_or[5][i].in[11] <== eq[53][i].out; + multi_or[5][i].in[12] <== eq[54][i].out; + multi_or[5][i].in[13] <== eq[55][i].out; + multi_or[5][i].in[14] <== eq[56][i].out; + multi_or[5][i].in[15] <== eq[57][i].out; + and[37][i].b <== multi_or[5][i].out; + multi_or[6][i] = MultiOR(5); + multi_or[6][i].in[0] <== and[32][i].out; + multi_or[6][i].in[1] <== and[33][i].out; + multi_or[6][i].in[2] <== and[35][i].out; + multi_or[6][i].in[3] <== and[36][i].out; + multi_or[6][i].in[4] <== and[37][i].out; + states[i+1][19] <== multi_or[6][i].out; eq[58][i] = IsEqual(); eq[58][i].in[0] <== in[i]; - eq[58][i].in[1] <== 142; + eq[58][i].in[1] <== 237; + and[38][i] = AND(); + and[38][i].a <== states[i][15]; + and[38][i].b <== eq[58][i].out; + and[39][i] = AND(); + and[39][i].a <== states[i][16]; + and[39][i].b <== eq[58][i].out; + multi_or[7][i] = MultiOR(2); + multi_or[7][i].in[0] <== and[38][i].out; + multi_or[7][i].in[1] <== and[39][i].out; + states[i+1][20] <== multi_or[7][i].out; eq[59][i] = IsEqual(); eq[59][i].in[0] <== in[i]; - eq[59][i].in[1] <== 143; - and[54][i] = AND(); - and[54][i].a <== states[i][18]; - multi_or[11][i] = MultiOR(16); - multi_or[11][i].in[0] <== eq[44][i].out; - multi_or[11][i].in[1] <== eq[45][i].out; - multi_or[11][i].in[2] <== eq[46][i].out; - multi_or[11][i].in[3] <== eq[47][i].out; - multi_or[11][i].in[4] <== eq[48][i].out; - multi_or[11][i].in[5] <== eq[49][i].out; - multi_or[11][i].in[6] <== eq[50][i].out; - multi_or[11][i].in[7] <== eq[51][i].out; - multi_or[11][i].in[8] <== eq[52][i].out; - multi_or[11][i].in[9] <== eq[53][i].out; - multi_or[11][i].in[10] <== eq[54][i].out; - multi_or[11][i].in[11] <== eq[55][i].out; - multi_or[11][i].in[12] <== eq[56][i].out; - multi_or[11][i].in[13] <== eq[57][i].out; - multi_or[11][i].in[14] <== eq[58][i].out; - multi_or[11][i].in[15] <== eq[59][i].out; - and[54][i].b <== multi_or[11][i].out; - and[55][i] = AND(); - and[55][i].a <== states[i][19]; - and[55][i].b <== multi_or[10][i].out; - and[56][i] = AND(); - and[56][i].a <== states[i][20]; - and[56][i].b <== multi_or[10][i].out; - and[57][i] = AND(); - and[57][i].a <== states[i][21]; - and[57][i].b <== multi_or[10][i].out; - and[58][i] = AND(); - and[58][i].a <== states[i][22]; - and[58][i].b <== multi_or[10][i].out; - and[59][i] = AND(); - and[59][i].a <== states[i][23]; - and[59][i].b <== multi_or[10][i].out; - and[60][i] = AND(); - and[60][i].a <== states[i][24]; - and[60][i].b <== multi_or[10][i].out; - multi_or[12][i] = MultiOR(10); - multi_or[12][i].in[0] <== and[50][i].out; - multi_or[12][i].in[1] <== and[52][i].out; - multi_or[12][i].in[2] <== and[53][i].out; - multi_or[12][i].in[3] <== and[54][i].out; - multi_or[12][i].in[4] <== and[55][i].out; - multi_or[12][i].in[5] <== and[56][i].out; - multi_or[12][i].in[6] <== and[57][i].out; - multi_or[12][i].in[7] <== and[58][i].out; - multi_or[12][i].in[8] <== and[59][i].out; - multi_or[12][i].in[9] <== and[60][i].out; - states[i+1][14] <== multi_or[12][i].out; + eq[59][i].in[1] <== 240; + and[40][i] = AND(); + and[40][i].a <== states[i][15]; + and[40][i].b <== eq[59][i].out; + and[41][i] = AND(); + and[41][i].a <== states[i][16]; + and[41][i].b <== eq[59][i].out; + multi_or[8][i] = MultiOR(2); + multi_or[8][i].in[0] <== and[40][i].out; + multi_or[8][i].in[1] <== and[41][i].out; + states[i+1][21] <== multi_or[8][i].out; eq[60][i] = IsEqual(); eq[60][i].in[0] <== in[i]; - eq[60][i].in[1] <== 237; - and[61][i] = AND(); - and[61][i].a <== states[i][11]; - and[61][i].b <== eq[60][i].out; - and[62][i] = AND(); - and[62][i].a <== states[i][19]; - and[62][i].b <== eq[60][i].out; - and[63][i] = AND(); - and[63][i].a <== states[i][20]; - and[63][i].b <== eq[60][i].out; - and[64][i] = AND(); - and[64][i].a <== states[i][21]; - and[64][i].b <== eq[60][i].out; - and[65][i] = AND(); - and[65][i].a <== states[i][22]; - and[65][i].b <== eq[60][i].out; - and[66][i] = AND(); - and[66][i].a <== states[i][23]; - and[66][i].b <== eq[60][i].out; - and[67][i] = AND(); - and[67][i].a <== states[i][24]; - and[67][i].b <== eq[60][i].out; - multi_or[13][i] = MultiOR(7); - multi_or[13][i].in[0] <== and[61][i].out; - multi_or[13][i].in[1] <== and[62][i].out; - multi_or[13][i].in[2] <== and[63][i].out; - multi_or[13][i].in[3] <== and[64][i].out; - multi_or[13][i].in[4] <== and[65][i].out; - multi_or[13][i].in[5] <== and[66][i].out; - multi_or[13][i].in[6] <== and[67][i].out; - states[i+1][15] <== multi_or[13][i].out; + eq[60][i].in[1] <== 241; eq[61][i] = IsEqual(); eq[61][i].in[0] <== in[i]; - eq[61][i].in[1] <== 240; - and[68][i] = AND(); - and[68][i].a <== states[i][11]; - and[68][i].b <== eq[61][i].out; - and[69][i] = AND(); - and[69][i].a <== states[i][19]; - and[69][i].b <== eq[61][i].out; - and[70][i] = AND(); - and[70][i].a <== states[i][20]; - and[70][i].b <== eq[61][i].out; - and[71][i] = AND(); - and[71][i].a <== states[i][21]; - and[71][i].b <== eq[61][i].out; - and[72][i] = AND(); - and[72][i].a <== states[i][22]; - and[72][i].b <== eq[61][i].out; - and[73][i] = AND(); - and[73][i].a <== states[i][23]; - and[73][i].b <== eq[61][i].out; - and[74][i] = AND(); - and[74][i].a <== states[i][24]; - and[74][i].b <== eq[61][i].out; - multi_or[14][i] = MultiOR(7); - multi_or[14][i].in[0] <== and[68][i].out; - multi_or[14][i].in[1] <== and[69][i].out; - multi_or[14][i].in[2] <== and[70][i].out; - multi_or[14][i].in[3] <== and[71][i].out; - multi_or[14][i].in[4] <== and[72][i].out; - multi_or[14][i].in[5] <== and[73][i].out; - multi_or[14][i].in[6] <== and[74][i].out; - states[i+1][16] <== multi_or[14][i].out; + eq[61][i].in[1] <== 242; eq[62][i] = IsEqual(); eq[62][i].in[0] <== in[i]; - eq[62][i].in[1] <== 241; + eq[62][i].in[1] <== 243; + and[42][i] = AND(); + and[42][i].a <== states[i][15]; + multi_or[9][i] = MultiOR(3); + multi_or[9][i].in[0] <== eq[60][i].out; + multi_or[9][i].in[1] <== eq[61][i].out; + multi_or[9][i].in[2] <== eq[62][i].out; + and[42][i].b <== multi_or[9][i].out; + and[43][i] = AND(); + and[43][i].a <== states[i][16]; + and[43][i].b <== multi_or[9][i].out; + multi_or[10][i] = MultiOR(2); + multi_or[10][i].in[0] <== and[42][i].out; + multi_or[10][i].in[1] <== and[43][i].out; + states[i+1][22] <== multi_or[10][i].out; eq[63][i] = IsEqual(); eq[63][i].in[0] <== in[i]; - eq[63][i].in[1] <== 242; + eq[63][i].in[1] <== 244; + and[44][i] = AND(); + and[44][i].a <== states[i][15]; + and[44][i].b <== eq[63][i].out; + and[45][i] = AND(); + and[45][i].a <== states[i][16]; + and[45][i].b <== eq[63][i].out; + multi_or[11][i] = MultiOR(2); + multi_or[11][i].in[0] <== and[44][i].out; + multi_or[11][i].in[1] <== and[45][i].out; + states[i+1][23] <== multi_or[11][i].out; + and[46][i] = AND(); + and[46][i].a <== states[i][16]; + and[46][i].b <== eq[0][i].out; + states[i+1][24] <== and[46][i].out; + and[47][i] = AND(); + and[47][i].a <== states[i][24]; + and[47][i].b <== eq[1][i].out; + states[i+1][25] <== and[47][i].out; + and[48][i] = AND(); + and[48][i].a <== states[i][25]; + and[48][i].b <== eq[2][i].out; + states[i+1][26] <== and[48][i].out; + and[49][i] = AND(); + and[49][i].a <== states[i][26]; + and[49][i].b <== eq[3][i].out; + states[i+1][27] <== and[49][i].out; + and[50][i] = AND(); + and[50][i].a <== states[i][27]; + and[50][i].b <== eq[4][i].out; + states[i+1][28] <== and[50][i].out; + and[51][i] = AND(); + and[51][i].a <== states[i][28]; + and[51][i].b <== eq[5][i].out; + states[i+1][29] <== and[51][i].out; + and[52][i] = AND(); + and[52][i].a <== states[i][29]; + and[52][i].b <== eq[6][i].out; + states[i+1][30] <== and[52][i].out; + and[53][i] = AND(); + and[53][i].a <== states[i][30]; + and[53][i].b <== eq[7][i].out; + states[i+1][31] <== and[53][i].out; + and[54][i] = AND(); + and[54][i].a <== states[i][31]; + and[54][i].b <== eq[8][i].out; + states[i+1][32] <== and[54][i].out; + and[55][i] = AND(); + and[55][i].a <== states[i][32]; + and[55][i].b <== eq[3][i].out; + states[i+1][33] <== and[55][i].out; + and[56][i] = AND(); + and[56][i].a <== states[i][33]; + and[56][i].b <== eq[11][i].out; + states[i+1][34] <== and[56][i].out; eq[64][i] = IsEqual(); eq[64][i].in[0] <== in[i]; - eq[64][i].in[1] <== 243; - and[75][i] = AND(); - and[75][i].a <== states[i][11]; - multi_or[15][i] = MultiOR(3); - multi_or[15][i].in[0] <== eq[62][i].out; - multi_or[15][i].in[1] <== eq[63][i].out; - multi_or[15][i].in[2] <== eq[64][i].out; - and[75][i].b <== multi_or[15][i].out; - and[76][i] = AND(); - and[76][i].a <== states[i][19]; - and[76][i].b <== multi_or[15][i].out; - and[77][i] = AND(); - and[77][i].a <== states[i][20]; - and[77][i].b <== multi_or[15][i].out; - and[78][i] = AND(); - and[78][i].a <== states[i][21]; - and[78][i].b <== multi_or[15][i].out; - and[79][i] = AND(); - and[79][i].a <== states[i][22]; - and[79][i].b <== multi_or[15][i].out; - and[80][i] = AND(); - and[80][i].a <== states[i][23]; - and[80][i].b <== multi_or[15][i].out; - and[81][i] = AND(); - and[81][i].a <== states[i][24]; - and[81][i].b <== multi_or[15][i].out; - multi_or[16][i] = MultiOR(7); - multi_or[16][i].in[0] <== and[75][i].out; - multi_or[16][i].in[1] <== and[76][i].out; - multi_or[16][i].in[2] <== and[77][i].out; - multi_or[16][i].in[3] <== and[78][i].out; - multi_or[16][i].in[4] <== and[79][i].out; - multi_or[16][i].in[5] <== and[80][i].out; - multi_or[16][i].in[6] <== and[81][i].out; - states[i+1][17] <== multi_or[16][i].out; - eq[65][i] = IsEqual(); - eq[65][i].in[0] <== in[i]; - eq[65][i].in[1] <== 244; - and[82][i] = AND(); - and[82][i].a <== states[i][11]; - and[82][i].b <== eq[65][i].out; - and[83][i] = AND(); - and[83][i].a <== states[i][19]; - and[83][i].b <== eq[65][i].out; - and[84][i] = AND(); - and[84][i].a <== states[i][20]; - and[84][i].b <== eq[65][i].out; - and[85][i] = AND(); - and[85][i].a <== states[i][21]; - and[85][i].b <== eq[65][i].out; - and[86][i] = AND(); - and[86][i].a <== states[i][22]; - and[86][i].b <== eq[65][i].out; - and[87][i] = AND(); - and[87][i].a <== states[i][23]; - and[87][i].b <== eq[65][i].out; - and[88][i] = AND(); - and[88][i].a <== states[i][24]; - and[88][i].b <== eq[65][i].out; - multi_or[17][i] = MultiOR(7); - multi_or[17][i].in[0] <== and[82][i].out; - multi_or[17][i].in[1] <== and[83][i].out; - multi_or[17][i].in[2] <== and[84][i].out; - multi_or[17][i].in[3] <== and[85][i].out; - multi_or[17][i].in[4] <== and[86][i].out; - multi_or[17][i].in[5] <== and[87][i].out; - multi_or[17][i].in[6] <== and[88][i].out; - states[i+1][18] <== multi_or[17][i].out; - eq[66][i] = IsEqual(); - eq[66][i].in[0] <== in[i]; - eq[66][i].in[1] <== 122; - and[89][i] = AND(); - and[89][i].a <== states[i][11]; - and[89][i].b <== eq[66][i].out; - and[90][i] = AND(); - and[90][i].a <== states[i][19]; - and[90][i].b <== eq[66][i].out; - and[91][i] = AND(); - and[91][i].a <== states[i][20]; - and[91][i].b <== eq[66][i].out; - and[92][i] = AND(); - and[92][i].a <== states[i][21]; - and[92][i].b <== eq[66][i].out; - and[93][i] = AND(); - and[93][i].a <== states[i][22]; - and[93][i].b <== eq[66][i].out; - and[94][i] = AND(); - and[94][i].a <== states[i][23]; - and[94][i].b <== eq[66][i].out; - and[95][i] = AND(); - and[95][i].a <== states[i][24]; - and[95][i].b <== eq[66][i].out; - multi_or[18][i] = MultiOR(7); - multi_or[18][i].in[0] <== and[89][i].out; - multi_or[18][i].in[1] <== and[90][i].out; - multi_or[18][i].in[2] <== and[91][i].out; - multi_or[18][i].in[3] <== and[92][i].out; - multi_or[18][i].in[4] <== and[93][i].out; - multi_or[18][i].in[5] <== and[94][i].out; - multi_or[18][i].in[6] <== and[95][i].out; - states[i+1][19] <== multi_or[18][i].out; - and[96][i] = AND(); - and[96][i].a <== states[i][19]; - and[96][i].b <== eq[28][i].out; - states[i+1][20] <== and[96][i].out; - eq[67][i] = IsEqual(); - eq[67][i].in[0] <== in[i]; - eq[67][i].in[1] <== 101; - and[97][i] = AND(); - and[97][i].a <== states[i][20]; - and[97][i].b <== eq[67][i].out; - states[i+1][21] <== and[97][i].out; - and[98][i] = AND(); - and[98][i].a <== states[i][21]; - and[98][i].b <== eq[15][i].out; - states[i+1][22] <== and[98][i].out; - eq[68][i] = IsEqual(); - eq[68][i].in[0] <== in[i]; - eq[68][i].in[1] <== 97; - and[99][i] = AND(); - and[99][i].a <== states[i][22]; - and[99][i].b <== eq[68][i].out; - states[i+1][23] <== and[99][i].out; - and[100][i] = AND(); - and[100][i].a <== states[i][23]; - and[100][i].b <== eq[2][i].out; - states[i+1][24] <== and[100][i].out; - and[101][i] = AND(); - and[101][i].a <== states[i][24]; - and[101][i].b <== eq[14][i].out; - lt[30][i] = LessEqThan(8); - lt[30][i].in[0] <== 35; - lt[30][i].in[1] <== in[i]; - lt[31][i] = LessEqThan(8); - lt[31][i].in[0] <== in[i]; - lt[31][i].in[1] <== 127; - and[102][i] = AND(); - and[102][i].a <== lt[30][i].out; - and[102][i].b <== lt[31][i].out; - and[103][i] = AND(); - and[103][i].a <== states[i][25]; - multi_or[19][i] = MultiOR(2); - multi_or[19][i].in[0] <== and[11][i].out; - multi_or[19][i].in[1] <== and[102][i].out; - and[103][i].b <== multi_or[19][i].out; - and[104][i] = AND(); - and[104][i].a <== states[i][27]; - and[104][i].b <== and[14][i].out; - multi_or[20][i] = MultiOR(3); - multi_or[20][i].in[0] <== and[101][i].out; - multi_or[20][i].in[1] <== and[103][i].out; - multi_or[20][i].in[2] <== and[104][i].out; - states[i+1][25] <== multi_or[20][i].out; - and[105][i] = AND(); - and[105][i].a <== states[i][25]; - and[105][i].b <== eq[8][i].out; - lt[32][i] = LessEqThan(8); - lt[32][i].in[0] <== 1; - lt[32][i].in[1] <== in[i]; - lt[33][i] = LessEqThan(8); - lt[33][i].in[0] <== in[i]; - lt[33][i].in[1] <== 61; - and[106][i] = AND(); - and[106][i].a <== lt[32][i].out; - and[106][i].b <== lt[33][i].out; - lt[34][i] = LessEqThan(8); - lt[34][i].in[0] <== 63; - lt[34][i].in[1] <== in[i]; - lt[35][i] = LessEqThan(8); - lt[35][i].in[0] <== in[i]; - lt[35][i].in[1] <== 127; - and[107][i] = AND(); - and[107][i].a <== lt[34][i].out; - and[107][i].b <== lt[35][i].out; - and[108][i] = AND(); - and[108][i].a <== states[i][26]; - multi_or[21][i] = MultiOR(2); - multi_or[21][i].in[0] <== and[106][i].out; - multi_or[21][i].in[1] <== and[107][i].out; - and[108][i].b <== multi_or[21][i].out; - and[109][i] = AND(); - and[109][i].a <== states[i][35]; - and[109][i].b <== and[14][i].out; - multi_or[22][i] = MultiOR(3); - multi_or[22][i].in[0] <== and[105][i].out; - multi_or[22][i].in[1] <== and[108][i].out; - multi_or[22][i].in[2] <== and[109][i].out; - states[i+1][26] <== multi_or[22][i].out; - and[110][i] = AND(); - and[110][i].a <== states[i][25]; - and[110][i].b <== and[30][i].out; - and[111][i] = AND(); - and[111][i].a <== states[i][28]; - and[111][i].b <== and[32][i].out; - and[112][i] = AND(); - and[112][i].a <== states[i][29]; - and[112][i].b <== and[14][i].out; - and[113][i] = AND(); - and[113][i].a <== states[i][30]; - and[113][i].b <== and[35][i].out; - multi_or[23][i] = MultiOR(4); - multi_or[23][i].in[0] <== and[110][i].out; - multi_or[23][i].in[1] <== and[111][i].out; - multi_or[23][i].in[2] <== and[112][i].out; - multi_or[23][i].in[3] <== and[113][i].out; - states[i+1][27] <== multi_or[23][i].out; - and[114][i] = AND(); - and[114][i].a <== states[i][25]; - and[114][i].b <== eq[29][i].out; - states[i+1][28] <== and[114][i].out; - and[115][i] = AND(); - and[115][i].a <== states[i][25]; - and[115][i].b <== multi_or[10][i].out; - and[116][i] = AND(); - and[116][i].a <== states[i][31]; - and[116][i].b <== and[51][i].out; - and[117][i] = AND(); - and[117][i].a <== states[i][32]; - and[117][i].b <== and[14][i].out; - and[118][i] = AND(); - and[118][i].a <== states[i][33]; - and[118][i].b <== multi_or[11][i].out; - multi_or[24][i] = MultiOR(4); - multi_or[24][i].in[0] <== and[115][i].out; - multi_or[24][i].in[1] <== and[116][i].out; - multi_or[24][i].in[2] <== and[117][i].out; - multi_or[24][i].in[3] <== and[118][i].out; - states[i+1][29] <== multi_or[24][i].out; - and[119][i] = AND(); - and[119][i].a <== states[i][25]; - and[119][i].b <== eq[60][i].out; - states[i+1][30] <== and[119][i].out; - and[120][i] = AND(); - and[120][i].a <== states[i][25]; - and[120][i].b <== eq[61][i].out; - states[i+1][31] <== and[120][i].out; - and[121][i] = AND(); - and[121][i].a <== states[i][25]; - and[121][i].b <== multi_or[15][i].out; - states[i+1][32] <== and[121][i].out; - and[122][i] = AND(); - and[122][i].a <== states[i][25]; - and[122][i].b <== eq[65][i].out; - states[i+1][33] <== and[122][i].out; - eq[69][i] = IsEqual(); - eq[69][i].in[0] <== in[i]; - eq[69][i].in[1] <== 62; - and[123][i] = AND(); - and[123][i].a <== states[i][26]; - and[123][i].b <== eq[69][i].out; - states[i+1][34] <== and[123][i].out; - and[124][i] = AND(); - and[124][i].a <== states[i][26]; - and[124][i].b <== and[30][i].out; - and[125][i] = AND(); - and[125][i].a <== states[i][36]; - and[125][i].b <== and[32][i].out; - and[126][i] = AND(); - and[126][i].a <== states[i][37]; - and[126][i].b <== and[14][i].out; - and[127][i] = AND(); - and[127][i].a <== states[i][38]; - and[127][i].b <== and[35][i].out; - multi_or[25][i] = MultiOR(4); - multi_or[25][i].in[0] <== and[124][i].out; - multi_or[25][i].in[1] <== and[125][i].out; - multi_or[25][i].in[2] <== and[126][i].out; - multi_or[25][i].in[3] <== and[127][i].out; - states[i+1][35] <== multi_or[25][i].out; - and[128][i] = AND(); - and[128][i].a <== states[i][26]; - and[128][i].b <== eq[29][i].out; - states[i+1][36] <== and[128][i].out; - and[129][i] = AND(); - and[129][i].a <== states[i][26]; - and[129][i].b <== multi_or[10][i].out; - and[130][i] = AND(); - and[130][i].a <== states[i][39]; - and[130][i].b <== and[51][i].out; - and[131][i] = AND(); - and[131][i].a <== states[i][40]; - and[131][i].b <== and[14][i].out; - and[132][i] = AND(); - and[132][i].a <== states[i][41]; - and[132][i].b <== multi_or[11][i].out; - multi_or[26][i] = MultiOR(4); - multi_or[26][i].in[0] <== and[129][i].out; - multi_or[26][i].in[1] <== and[130][i].out; - multi_or[26][i].in[2] <== and[131][i].out; - multi_or[26][i].in[3] <== and[132][i].out; - states[i+1][37] <== multi_or[26][i].out; - and[133][i] = AND(); - and[133][i].a <== states[i][26]; - and[133][i].b <== eq[60][i].out; - states[i+1][38] <== and[133][i].out; - and[134][i] = AND(); - and[134][i].a <== states[i][26]; - and[134][i].b <== eq[61][i].out; - states[i+1][39] <== and[134][i].out; - and[135][i] = AND(); - and[135][i].a <== states[i][26]; - and[135][i].b <== multi_or[15][i].out; - states[i+1][40] <== and[135][i].out; - and[136][i] = AND(); - and[136][i].a <== states[i][26]; - and[136][i].b <== eq[65][i].out; - states[i+1][41] <== and[136][i].out; - lt[36][i] = LessEqThan(8); - lt[36][i].in[0] <== 1; - lt[36][i].in[1] <== in[i]; - lt[37][i] = LessEqThan(8); - lt[37][i].in[0] <== in[i]; - lt[37][i].in[1] <== 46; - and[137][i] = AND(); - and[137][i].a <== lt[36][i].out; - and[137][i].b <== lt[37][i].out; - eq[70][i] = IsEqual(); - eq[70][i].in[0] <== in[i]; - eq[70][i].in[1] <== 48; - eq[71][i] = IsEqual(); - eq[71][i].in[0] <== in[i]; - eq[71][i].in[1] <== 49; - eq[72][i] = IsEqual(); - eq[72][i].in[0] <== in[i]; - eq[72][i].in[1] <== 50; - eq[73][i] = IsEqual(); - eq[73][i].in[0] <== in[i]; - eq[73][i].in[1] <== 52; - eq[74][i] = IsEqual(); - eq[74][i].in[0] <== in[i]; - eq[74][i].in[1] <== 53; - eq[75][i] = IsEqual(); - eq[75][i].in[0] <== in[i]; - eq[75][i].in[1] <== 54; - eq[76][i] = IsEqual(); - eq[76][i].in[0] <== in[i]; - eq[76][i].in[1] <== 55; - eq[77][i] = IsEqual(); - eq[77][i].in[0] <== in[i]; - eq[77][i].in[1] <== 56; - eq[78][i] = IsEqual(); - eq[78][i].in[0] <== in[i]; - eq[78][i].in[1] <== 57; - eq[79][i] = IsEqual(); - eq[79][i].in[0] <== in[i]; - eq[79][i].in[1] <== 58; - eq[80][i] = IsEqual(); - eq[80][i].in[0] <== in[i]; - eq[80][i].in[1] <== 59; - and[138][i] = AND(); - and[138][i].a <== states[i][34]; - multi_or[27][i] = MultiOR(15); - multi_or[27][i].in[0] <== and[137][i].out; - multi_or[27][i].in[1] <== and[107][i].out; - multi_or[27][i].in[2] <== eq[70][i].out; - multi_or[27][i].in[3] <== eq[71][i].out; - multi_or[27][i].in[4] <== eq[72][i].out; - multi_or[27][i].in[5] <== eq[6][i].out; - multi_or[27][i].in[6] <== eq[73][i].out; - multi_or[27][i].in[7] <== eq[74][i].out; - multi_or[27][i].in[8] <== eq[75][i].out; - multi_or[27][i].in[9] <== eq[76][i].out; - multi_or[27][i].in[10] <== eq[77][i].out; - multi_or[27][i].in[11] <== eq[78][i].out; - multi_or[27][i].in[12] <== eq[79][i].out; - multi_or[27][i].in[13] <== eq[80][i].out; - multi_or[27][i].in[14] <== eq[5][i].out; - and[138][i].b <== multi_or[27][i].out; - and[139][i] = AND(); - and[139][i].a <== states[i][42]; - and[139][i].b <== multi_or[27][i].out; - and[140][i] = AND(); - and[140][i].a <== states[i][43]; - and[140][i].b <== and[14][i].out; - multi_or[28][i] = MultiOR(3); - multi_or[28][i].in[0] <== and[138][i].out; - multi_or[28][i].in[1] <== and[139][i].out; - multi_or[28][i].in[2] <== and[140][i].out; - states[i+1][42] <== multi_or[28][i].out; - and[141][i] = AND(); - and[141][i].a <== states[i][34]; - and[141][i].b <== and[30][i].out; - and[142][i] = AND(); - and[142][i].a <== states[i][42]; - and[142][i].b <== and[30][i].out; - and[143][i] = AND(); - and[143][i].a <== states[i][44]; - and[143][i].b <== and[32][i].out; - and[144][i] = AND(); - and[144][i].a <== states[i][45]; - and[144][i].b <== and[14][i].out; - and[145][i] = AND(); - and[145][i].a <== states[i][46]; - and[145][i].b <== and[35][i].out; - multi_or[29][i] = MultiOR(5); - multi_or[29][i].in[0] <== and[141][i].out; - multi_or[29][i].in[1] <== and[142][i].out; - multi_or[29][i].in[2] <== and[143][i].out; - multi_or[29][i].in[3] <== and[144][i].out; - multi_or[29][i].in[4] <== and[145][i].out; - states[i+1][43] <== multi_or[29][i].out; - and[146][i] = AND(); - and[146][i].a <== states[i][34]; - and[146][i].b <== eq[29][i].out; - and[147][i] = AND(); - and[147][i].a <== states[i][42]; - and[147][i].b <== eq[29][i].out; - multi_or[30][i] = MultiOR(2); - multi_or[30][i].in[0] <== and[146][i].out; - multi_or[30][i].in[1] <== and[147][i].out; - states[i+1][44] <== multi_or[30][i].out; - and[148][i] = AND(); - and[148][i].a <== states[i][34]; - and[148][i].b <== multi_or[10][i].out; - and[149][i] = AND(); - and[149][i].a <== states[i][42]; - and[149][i].b <== multi_or[10][i].out; - and[150][i] = AND(); - and[150][i].a <== states[i][47]; - and[150][i].b <== and[51][i].out; - and[151][i] = AND(); - and[151][i].a <== states[i][48]; - and[151][i].b <== and[14][i].out; - and[152][i] = AND(); - and[152][i].a <== states[i][49]; - and[152][i].b <== multi_or[11][i].out; - multi_or[31][i] = MultiOR(5); - multi_or[31][i].in[0] <== and[148][i].out; - multi_or[31][i].in[1] <== and[149][i].out; - multi_or[31][i].in[2] <== and[150][i].out; - multi_or[31][i].in[3] <== and[151][i].out; - multi_or[31][i].in[4] <== and[152][i].out; - states[i+1][45] <== multi_or[31][i].out; - and[153][i] = AND(); - and[153][i].a <== states[i][34]; - and[153][i].b <== eq[60][i].out; - and[154][i] = AND(); - and[154][i].a <== states[i][42]; - and[154][i].b <== eq[60][i].out; - multi_or[32][i] = MultiOR(2); - multi_or[32][i].in[0] <== and[153][i].out; - multi_or[32][i].in[1] <== and[154][i].out; - states[i+1][46] <== multi_or[32][i].out; - and[155][i] = AND(); - and[155][i].a <== states[i][34]; - and[155][i].b <== eq[61][i].out; - and[156][i] = AND(); - and[156][i].a <== states[i][42]; - and[156][i].b <== eq[61][i].out; - multi_or[33][i] = MultiOR(2); - multi_or[33][i].in[0] <== and[155][i].out; - multi_or[33][i].in[1] <== and[156][i].out; - states[i+1][47] <== multi_or[33][i].out; - and[157][i] = AND(); - and[157][i].a <== states[i][34]; - and[157][i].b <== multi_or[15][i].out; - and[158][i] = AND(); - and[158][i].a <== states[i][42]; - and[158][i].b <== multi_or[15][i].out; - multi_or[34][i] = MultiOR(2); - multi_or[34][i].in[0] <== and[157][i].out; - multi_or[34][i].in[1] <== and[158][i].out; - states[i+1][48] <== multi_or[34][i].out; - and[159][i] = AND(); - and[159][i].a <== states[i][34]; - and[159][i].b <== eq[65][i].out; - and[160][i] = AND(); - and[160][i].a <== states[i][42]; - and[160][i].b <== eq[65][i].out; - multi_or[35][i] = MultiOR(2); - multi_or[35][i].in[0] <== and[159][i].out; - multi_or[35][i].in[1] <== and[160][i].out; - states[i+1][49] <== multi_or[35][i].out; - and[161][i] = AND(); - and[161][i].a <== states[i][42]; - and[161][i].b <== eq[0][i].out; - states[i+1][50] <== and[161][i].out; - eq[81][i] = IsEqual(); - eq[81][i].in[0] <== in[i]; - eq[81][i].in[1] <== 47; - and[162][i] = AND(); - and[162][i].a <== states[i][50]; - and[162][i].b <== eq[81][i].out; - states[i+1][51] <== and[162][i].out; - and[163][i] = AND(); - and[163][i].a <== states[i][51]; - and[163][i].b <== eq[1][i].out; - states[i+1][52] <== and[163][i].out; - and[164][i] = AND(); - and[164][i].a <== states[i][52]; - and[164][i].b <== eq[2][i].out; - states[i+1][53] <== and[164][i].out; - and[165][i] = AND(); - and[165][i].a <== states[i][53]; - and[165][i].b <== eq[3][i].out; - states[i+1][54] <== and[165][i].out; - and[166][i] = AND(); - and[166][i].a <== states[i][54]; - and[166][i].b <== eq[69][i].out; - states[i+1][55] <== and[166][i].out; - from_zero_enabled[i] <== MultiNOR(55)([states_tmp[i+1][1], states[i+1][2], states[i+1][3], states[i+1][4], states[i+1][5], states[i+1][6], states[i+1][7], states[i+1][8], states[i+1][9], states[i+1][10], states[i+1][11], states[i+1][12], states[i+1][13], states[i+1][14], states[i+1][15], states[i+1][16], states[i+1][17], states[i+1][18], states[i+1][19], states[i+1][20], states[i+1][21], states[i+1][22], states[i+1][23], states[i+1][24], states[i+1][25], states[i+1][26], states[i+1][27], states[i+1][28], states[i+1][29], states[i+1][30], states[i+1][31], states[i+1][32], states[i+1][33], states[i+1][34], states[i+1][35], states[i+1][36], states[i+1][37], states[i+1][38], states[i+1][39], states[i+1][40], states[i+1][41], states[i+1][42], states[i+1][43], states[i+1][44], states[i+1][45], states[i+1][46], states[i+1][47], states[i+1][48], states[i+1][49], states[i+1][50], states[i+1][51], states[i+1][52], states[i+1][53], states[i+1][54], states[i+1][55]]); + eq[64][i].in[1] <== 100; + and[57][i] = AND(); + and[57][i].a <== states[i][34]; + and[57][i].b <== eq[64][i].out; + states[i+1][35] <== and[57][i].out; + and[58][i] = AND(); + and[58][i].a <== states[i][35]; + and[58][i].b <== eq[12][i].out; + states[i+1][36] <== and[58][i].out; + from_zero_enabled[i] <== MultiNOR(36)([states_tmp[i+1][1], states[i+1][2], states[i+1][3], states[i+1][4], states[i+1][5], states[i+1][6], states[i+1][7], states[i+1][8], states[i+1][9], states[i+1][10], states[i+1][11], states[i+1][12], states[i+1][13], states[i+1][14], states[i+1][15], states[i+1][16], states[i+1][17], states[i+1][18], states[i+1][19], states[i+1][20], states[i+1][21], states[i+1][22], states[i+1][23], states[i+1][24], states[i+1][25], states[i+1][26], states[i+1][27], states[i+1][28], states[i+1][29], states[i+1][30], states[i+1][31], states[i+1][32], states[i+1][33], states[i+1][34], states[i+1][35], states[i+1][36]]); states[i+1][1] <== MultiOR(2)([states_tmp[i+1][1], from_zero_enabled[i] * and[0][i].out]); state_changed[i].in[0] <== states[i+1][1]; state_changed[i].in[1] <== states[i+1][2]; @@ -1298,70 +613,51 @@ template CommandRegex(msg_bytes) { state_changed[i].in[33] <== states[i+1][34]; state_changed[i].in[34] <== states[i+1][35]; state_changed[i].in[35] <== states[i+1][36]; - state_changed[i].in[36] <== states[i+1][37]; - state_changed[i].in[37] <== states[i+1][38]; - state_changed[i].in[38] <== states[i+1][39]; - state_changed[i].in[39] <== states[i+1][40]; - state_changed[i].in[40] <== states[i+1][41]; - state_changed[i].in[41] <== states[i+1][42]; - state_changed[i].in[42] <== states[i+1][43]; - state_changed[i].in[43] <== states[i+1][44]; - state_changed[i].in[44] <== states[i+1][45]; - state_changed[i].in[45] <== states[i+1][46]; - state_changed[i].in[46] <== states[i+1][47]; - state_changed[i].in[47] <== states[i+1][48]; - state_changed[i].in[48] <== states[i+1][49]; - state_changed[i].in[49] <== states[i+1][50]; - state_changed[i].in[50] <== states[i+1][51]; - state_changed[i].in[51] <== states[i+1][52]; - state_changed[i].in[52] <== states[i+1][53]; - state_changed[i].in[53] <== states[i+1][54]; - state_changed[i].in[54] <== states[i+1][55]; } component is_accepted = MultiOR(num_bytes+1); for (var i = 0; i <= num_bytes; i++) { - is_accepted.in[i] <== states[i][55]; + is_accepted.in[i] <== states[i][36]; } out <== is_accepted.out; signal is_consecutive[msg_bytes+1][3]; is_consecutive[msg_bytes][2] <== 0; for (var i = 0; i < msg_bytes; i++) { - is_consecutive[msg_bytes-1-i][0] <== states[num_bytes-i][55] * (1 - is_consecutive[msg_bytes-i][2]) + is_consecutive[msg_bytes-i][2]; + is_consecutive[msg_bytes-1-i][0] <== states[num_bytes-i][36] * (1 - is_consecutive[msg_bytes-i][2]) + is_consecutive[msg_bytes-i][2]; is_consecutive[msg_bytes-1-i][1] <== state_changed[msg_bytes-i].out * is_consecutive[msg_bytes-1-i][0]; - is_consecutive[msg_bytes-1-i][2] <== ORAnd()([(1 - from_zero_enabled[msg_bytes-i+1]), states[num_bytes-i][55], is_consecutive[msg_bytes-1-i][1]]); + is_consecutive[msg_bytes-1-i][2] <== ORAnd()([(1 - from_zero_enabled[msg_bytes-i+1]), states[num_bytes-i][36], is_consecutive[msg_bytes-1-i][1]]); } - // substrings calculated: [{(34, 42), (34, 43), (34, 44), (34, 45), (34, 46), (34, 47), (34, 48), (34, 49), (42, 42), (42, 43), (42, 44), (42, 45), (42, 46), (42, 47), (42, 48), (42, 49), (43, 42), (44, 43), (45, 43), (46, 43), (47, 45), (48, 45), (49, 45)}] + // substrings calculated: [{(15, 16), (15, 17), (15, 18), (15, 19), (15, 20), (15, 21), (15, 22), (15, 23), (16, 16), (16, 17), (16, 18), (16, 19), (16, 20), (16, 21), (16, 22), (16, 23), (17, 16), (18, 17), (19, 17), (20, 17), (21, 19), (22, 19), (23, 19)}] signal prev_states0[23][msg_bytes]; signal is_substr0[msg_bytes]; signal is_reveal0[msg_bytes]; signal output reveal0[msg_bytes]; for (var i = 0; i < msg_bytes; i++) { - // the 0-th substring transitions: [(34, 42), (34, 43), (34, 44), (34, 45), (34, 46), (34, 47), (34, 48), (34, 49), (42, 42), (42, 43), (42, 44), (42, 45), (42, 46), (42, 47), (42, 48), (42, 49), (43, 42), (44, 43), (45, 43), (46, 43), (47, 45), (48, 45), (49, 45)] - prev_states0[0][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[1][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[2][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[3][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[4][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[5][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[6][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[7][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][34]; - prev_states0[8][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[9][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[10][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[11][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[12][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[13][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[14][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[15][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][42]; - prev_states0[16][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][43]; - prev_states0[17][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][44]; - prev_states0[18][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][45]; - prev_states0[19][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][46]; - prev_states0[20][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][47]; - prev_states0[21][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][48]; - prev_states0[22][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][49]; - is_substr0[i] <== MultiOR(23)([prev_states0[0][i] * states[i+2][42], prev_states0[1][i] * states[i+2][43], prev_states0[2][i] * states[i+2][44], prev_states0[3][i] * states[i+2][45], prev_states0[4][i] * states[i+2][46], prev_states0[5][i] * states[i+2][47], prev_states0[6][i] * states[i+2][48], prev_states0[7][i] * states[i+2][49], prev_states0[8][i] * states[i+2][42], prev_states0[9][i] * states[i+2][43], prev_states0[10][i] * states[i+2][44], prev_states0[11][i] * states[i+2][45], prev_states0[12][i] * states[i+2][46], prev_states0[13][i] * states[i+2][47], prev_states0[14][i] * states[i+2][48], prev_states0[15][i] * states[i+2][49], prev_states0[16][i] * states[i+2][42], prev_states0[17][i] * states[i+2][43], prev_states0[18][i] * states[i+2][43], prev_states0[19][i] * states[i+2][43], prev_states0[20][i] * states[i+2][45], prev_states0[21][i] * states[i+2][45], prev_states0[22][i] * states[i+2][45]]); + // the 0-th substring transitions: [(15, 16), (15, 17), (15, 18), (15, 19), (15, 20), (15, 21), (15, 22), (15, 23), (16, 16), (16, 17), (16, 18), (16, 19), (16, 20), (16, 21), (16, 22), (16, 23), (17, 16), (18, 17), (19, 17), (20, 17), (21, 19), (22, 19), (23, 19)] + prev_states0[0][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[1][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[2][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[3][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[4][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[5][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[6][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[7][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][15]; + prev_states0[8][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[9][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[10][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[11][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[12][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[13][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[14][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[15][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][16]; + prev_states0[16][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][17]; + prev_states0[17][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][18]; + prev_states0[18][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][19]; + prev_states0[19][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][20]; + prev_states0[20][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][21]; + prev_states0[21][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][22]; + prev_states0[22][i] <== (1 - from_zero_enabled[i+1]) * states[i+1][23]; + is_substr0[i] <== MultiOR(23)([prev_states0[0][i] * states[i+2][16], prev_states0[1][i] * states[i+2][17], prev_states0[2][i] * states[i+2][18], prev_states0[3][i] * states[i+2][19], prev_states0[4][i] * states[i+2][20], prev_states0[5][i] * states[i+2][21], prev_states0[6][i] * states[i+2][22], prev_states0[7][i] * states[i+2][23], prev_states0[8][i] * states[i+2][16], prev_states0[9][i] * states[i+2][17], prev_states0[10][i] * states[i+2][18], prev_states0[11][i] * states[i+2][19], prev_states0[12][i] * states[i+2][20], prev_states0[13][i] * states[i+2][21], prev_states0[14][i] * states[i+2][22], prev_states0[15][i] * states[i+2][23], prev_states0[16][i] * states[i+2][16], prev_states0[17][i] * states[i+2][17], prev_states0[18][i] * states[i+2][17], prev_states0[19][i] * states[i+2][17], prev_states0[20][i] * states[i+2][19], prev_states0[21][i] * states[i+2][19], prev_states0[22][i] * states[i+2][19]]); is_reveal0[i] <== MultiAND(3)([out, is_substr0[i], is_consecutive[i][2]]); reveal0[i] <== in[i+1] * is_reveal0[i]; } diff --git a/packages/circuits/src/regexes/forced_subject.json b/packages/circuits/src/regexes/forced_subject.json index 939953f..cd009c7 100644 --- a/packages/circuits/src/regexes/forced_subject.json +++ b/packages/circuits/src/regexes/forced_subject.json @@ -2,7 +2,7 @@ "parts": [ { "is_public": false, - "regex_def": "(\r\n|^)subject:((re: )|(RE: )|(Re: )|(fwd: )|(FWD: )|(Fwd: ))*\\[Reply Needed\\][^\r\n]*\r\n" + "regex_def": "(\r\n|^)subject:[^\\[]*\\[Reply Needed\\][^\r\n]*\r\n" } ] } \ No newline at end of file diff --git a/packages/circuits/src/regexes/forced_subject_regex.circom b/packages/circuits/src/regexes/forced_subject_regex.circom index 62fb9dc..790b3d8 100644 --- a/packages/circuits/src/regexes/forced_subject_regex.circom +++ b/packages/circuits/src/regexes/forced_subject_regex.circom @@ -2,7 +2,7 @@ pragma circom 2.1.5; include "@zk-email/zk-regex-circom/circuits/regex_helpers.circom"; -// regex: (\r\n|^)subject:((re: )|(RE: )|(Re: )|(fwd: )|(FWD: )|(Fwd: ))*\[Reply Needed\][^\r\n]*\r\n +// regex: (\r\n|^)subject:[^\[]*\[Reply Needed\][^\r\n]*\r\n template ForcedSubjectRegex(msg_bytes) { signal input msg[msg_bytes]; signal output out; @@ -17,22 +17,22 @@ template ForcedSubjectRegex(msg_bytes) { in[i+1] <== msg[i]; } - component eq[75][num_bytes]; - component lt[12][num_bytes]; - component and[61][num_bytes]; + component eq[68][num_bytes]; + component lt[16][num_bytes]; + component and[65][num_bytes]; component multi_or[11][num_bytes]; - signal states[num_bytes+1][42]; - signal states_tmp[num_bytes+1][42]; + signal states[num_bytes+1][41]; + signal states_tmp[num_bytes+1][41]; signal from_zero_enabled[num_bytes+1]; from_zero_enabled[num_bytes] <== 0; component state_changed[num_bytes]; - for (var i = 1; i < 42; i++) { + for (var i = 1; i < 41; i++) { states[0][i] <== 0; } for (var i = 0; i < num_bytes; i++) { - state_changed[i] = MultiOR(41); + state_changed[i] = MultiOR(40); states[i][0] <== 1; eq[0][i] = IsEqual(); eq[0][i].in[0] <== in[i]; @@ -109,494 +109,499 @@ template ForcedSubjectRegex(msg_bytes) { and[10][i] = AND(); and[10][i].a <== states[i][9]; and[10][i].b <== eq[10][i].out; - eq[11][i] = IsEqual(); - eq[11][i].in[0] <== in[i]; - eq[11][i].in[1] <== 32; + lt[0][i] = LessEqThan(8); + lt[0][i].in[0] <== 1; + lt[0][i].in[1] <== in[i]; + lt[1][i] = LessEqThan(8); + lt[1][i].in[0] <== in[i]; + lt[1][i].in[1] <== 90; and[11][i] = AND(); - and[11][i].a <== states[i][20]; - and[11][i].b <== eq[11][i].out; + and[11][i].a <== lt[0][i].out; + and[11][i].b <== lt[1][i].out; + lt[2][i] = LessEqThan(8); + lt[2][i].in[0] <== 92; + lt[2][i].in[1] <== in[i]; + lt[3][i] = LessEqThan(8); + lt[3][i].in[0] <== in[i]; + lt[3][i].in[1] <== 127; + and[12][i] = AND(); + and[12][i].a <== lt[2][i].out; + and[12][i].b <== lt[3][i].out; + and[13][i] = AND(); + and[13][i].a <== states[i][10]; multi_or[0][i] = MultiOR(2); - multi_or[0][i].in[0] <== and[10][i].out; - multi_or[0][i].in[1] <== and[11][i].out; - states[i+1][10] <== multi_or[0][i].out; + multi_or[0][i].in[0] <== and[11][i].out; + multi_or[0][i].in[1] <== and[12][i].out; + and[13][i].b <== multi_or[0][i].out; + lt[4][i] = LessEqThan(8); + lt[4][i].in[0] <== 128; + lt[4][i].in[1] <== in[i]; + lt[5][i] = LessEqThan(8); + lt[5][i].in[0] <== in[i]; + lt[5][i].in[1] <== 191; + and[14][i] = AND(); + and[14][i].a <== lt[4][i].out; + and[14][i].b <== lt[5][i].out; + and[15][i] = AND(); + and[15][i].a <== states[i][12]; + and[15][i].b <== and[14][i].out; + multi_or[1][i] = MultiOR(3); + multi_or[1][i].in[0] <== and[10][i].out; + multi_or[1][i].in[1] <== and[13][i].out; + multi_or[1][i].in[2] <== and[15][i].out; + states[i+1][10] <== multi_or[1][i].out; + eq[11][i] = IsEqual(); + eq[11][i].in[0] <== in[i]; + eq[11][i].in[1] <== 91; + and[16][i] = AND(); + and[16][i].a <== states[i][10]; + and[16][i].b <== eq[11][i].out; + states[i+1][11] <== and[16][i].out; + lt[6][i] = LessEqThan(8); + lt[6][i].in[0] <== 194; + lt[6][i].in[1] <== in[i]; + lt[7][i] = LessEqThan(8); + lt[7][i].in[0] <== in[i]; + lt[7][i].in[1] <== 223; + and[17][i] = AND(); + and[17][i].a <== lt[6][i].out; + and[17][i].b <== lt[7][i].out; + and[18][i] = AND(); + and[18][i].a <== states[i][10]; + and[18][i].b <== and[17][i].out; + lt[8][i] = LessEqThan(8); + lt[8][i].in[0] <== 160; + lt[8][i].in[1] <== in[i]; + lt[9][i] = LessEqThan(8); + lt[9][i].in[0] <== in[i]; + lt[9][i].in[1] <== 191; + and[19][i] = AND(); + and[19][i].a <== lt[8][i].out; + and[19][i].b <== lt[9][i].out; + and[20][i] = AND(); + and[20][i].a <== states[i][13]; + and[20][i].b <== and[19][i].out; + and[21][i] = AND(); + and[21][i].a <== states[i][14]; + and[21][i].b <== and[14][i].out; + lt[10][i] = LessEqThan(8); + lt[10][i].in[0] <== 128; + lt[10][i].in[1] <== in[i]; + lt[11][i] = LessEqThan(8); + lt[11][i].in[0] <== in[i]; + lt[11][i].in[1] <== 159; + and[22][i] = AND(); + and[22][i].a <== lt[10][i].out; + and[22][i].b <== lt[11][i].out; + and[23][i] = AND(); + and[23][i].a <== states[i][15]; + and[23][i].b <== and[22][i].out; + multi_or[2][i] = MultiOR(4); + multi_or[2][i].in[0] <== and[18][i].out; + multi_or[2][i].in[1] <== and[20][i].out; + multi_or[2][i].in[2] <== and[21][i].out; + multi_or[2][i].in[3] <== and[23][i].out; + states[i+1][12] <== multi_or[2][i].out; eq[12][i] = IsEqual(); eq[12][i].in[0] <== in[i]; - eq[12][i].in[1] <== 70; - and[12][i] = AND(); - and[12][i].a <== states[i][10]; - and[12][i].b <== eq[12][i].out; - states[i+1][11] <== and[12][i].out; + eq[12][i].in[1] <== 224; + and[24][i] = AND(); + and[24][i].a <== states[i][10]; + and[24][i].b <== eq[12][i].out; + states[i+1][13] <== and[24][i].out; eq[13][i] = IsEqual(); eq[13][i].in[0] <== in[i]; - eq[13][i].in[1] <== 82; - and[13][i] = AND(); - and[13][i].a <== states[i][10]; - and[13][i].b <== eq[13][i].out; - states[i+1][12] <== and[13][i].out; + eq[13][i].in[1] <== 225; eq[14][i] = IsEqual(); eq[14][i].in[0] <== in[i]; - eq[14][i].in[1] <== 91; - and[14][i] = AND(); - and[14][i].a <== states[i][10]; - and[14][i].b <== eq[14][i].out; - states[i+1][13] <== and[14][i].out; + eq[14][i].in[1] <== 226; eq[15][i] = IsEqual(); eq[15][i].in[0] <== in[i]; - eq[15][i].in[1] <== 102; - and[15][i] = AND(); - and[15][i].a <== states[i][10]; - and[15][i].b <== eq[15][i].out; - states[i+1][14] <== and[15][i].out; + eq[15][i].in[1] <== 227; eq[16][i] = IsEqual(); eq[16][i].in[0] <== in[i]; - eq[16][i].in[1] <== 114; - and[16][i] = AND(); - and[16][i].a <== states[i][10]; - and[16][i].b <== eq[16][i].out; - states[i+1][15] <== and[16][i].out; + eq[16][i].in[1] <== 228; eq[17][i] = IsEqual(); eq[17][i].in[0] <== in[i]; - eq[17][i].in[1] <== 87; - and[17][i] = AND(); - and[17][i].a <== states[i][11]; - and[17][i].b <== eq[17][i].out; - states[i+1][16] <== and[17][i].out; + eq[17][i].in[1] <== 229; eq[18][i] = IsEqual(); eq[18][i].in[0] <== in[i]; - eq[18][i].in[1] <== 119; - and[18][i] = AND(); - and[18][i].a <== states[i][11]; - and[18][i].b <== eq[18][i].out; - and[19][i] = AND(); - and[19][i].a <== states[i][14]; - and[19][i].b <== eq[18][i].out; - multi_or[1][i] = MultiOR(2); - multi_or[1][i].in[0] <== and[18][i].out; - multi_or[1][i].in[1] <== and[19][i].out; - states[i+1][17] <== multi_or[1][i].out; + eq[18][i].in[1] <== 230; eq[19][i] = IsEqual(); eq[19][i].in[0] <== in[i]; - eq[19][i].in[1] <== 69; - and[20][i] = AND(); - and[20][i].a <== states[i][12]; - multi_or[2][i] = MultiOR(2); - multi_or[2][i].in[0] <== eq[19][i].out; - multi_or[2][i].in[1] <== eq[7][i].out; - and[20][i].b <== multi_or[2][i].out; - and[21][i] = AND(); - and[21][i].a <== states[i][15]; - and[21][i].b <== eq[7][i].out; + eq[19][i].in[1] <== 231; eq[20][i] = IsEqual(); eq[20][i].in[0] <== in[i]; - eq[20][i].in[1] <== 68; - and[22][i] = AND(); - and[22][i].a <== states[i][16]; - and[22][i].b <== eq[20][i].out; + eq[20][i].in[1] <== 232; eq[21][i] = IsEqual(); eq[21][i].in[0] <== in[i]; - eq[21][i].in[1] <== 100; - and[23][i] = AND(); - and[23][i].a <== states[i][17]; - and[23][i].b <== eq[21][i].out; - multi_or[3][i] = MultiOR(4); - multi_or[3][i].in[0] <== and[20][i].out; - multi_or[3][i].in[1] <== and[21][i].out; - multi_or[3][i].in[2] <== and[22][i].out; - multi_or[3][i].in[3] <== and[23][i].out; - states[i+1][18] <== multi_or[3][i].out; - and[24][i] = AND(); - and[24][i].a <== states[i][13]; - and[24][i].b <== eq[13][i].out; - states[i+1][19] <== and[24][i].out; - and[25][i] = AND(); - and[25][i].a <== states[i][18]; - and[25][i].b <== eq[10][i].out; - states[i+1][20] <== and[25][i].out; - and[26][i] = AND(); - and[26][i].a <== states[i][19]; - and[26][i].b <== eq[7][i].out; - states[i+1][21] <== and[26][i].out; + eq[21][i].in[1] <== 233; eq[22][i] = IsEqual(); eq[22][i].in[0] <== in[i]; - eq[22][i].in[1] <== 112; - and[27][i] = AND(); - and[27][i].a <== states[i][21]; - and[27][i].b <== eq[22][i].out; - states[i+1][22] <== and[27][i].out; + eq[22][i].in[1] <== 234; eq[23][i] = IsEqual(); eq[23][i].in[0] <== in[i]; - eq[23][i].in[1] <== 108; - and[28][i] = AND(); - and[28][i].a <== states[i][22]; - and[28][i].b <== eq[23][i].out; - states[i+1][23] <== and[28][i].out; + eq[23][i].in[1] <== 235; eq[24][i] = IsEqual(); eq[24][i].in[0] <== in[i]; - eq[24][i].in[1] <== 121; - and[29][i] = AND(); - and[29][i].a <== states[i][23]; - and[29][i].b <== eq[24][i].out; - states[i+1][24] <== and[29][i].out; - and[30][i] = AND(); - and[30][i].a <== states[i][24]; - and[30][i].b <== eq[11][i].out; - states[i+1][25] <== and[30][i].out; + eq[24][i].in[1] <== 236; eq[25][i] = IsEqual(); eq[25][i].in[0] <== in[i]; - eq[25][i].in[1] <== 78; - and[31][i] = AND(); - and[31][i].a <== states[i][25]; - and[31][i].b <== eq[25][i].out; - states[i+1][26] <== and[31][i].out; - and[32][i] = AND(); - and[32][i].a <== states[i][26]; - and[32][i].b <== eq[7][i].out; - states[i+1][27] <== and[32][i].out; - and[33][i] = AND(); - and[33][i].a <== states[i][27]; - and[33][i].b <== eq[7][i].out; - states[i+1][28] <== and[33][i].out; - and[34][i] = AND(); - and[34][i].a <== states[i][28]; - and[34][i].b <== eq[21][i].out; - states[i+1][29] <== and[34][i].out; - and[35][i] = AND(); - and[35][i].a <== states[i][29]; - and[35][i].b <== eq[7][i].out; - states[i+1][30] <== and[35][i].out; - and[36][i] = AND(); - and[36][i].a <== states[i][30]; - and[36][i].b <== eq[21][i].out; - states[i+1][31] <== and[36][i].out; + eq[25][i].in[1] <== 238; eq[26][i] = IsEqual(); eq[26][i].in[0] <== in[i]; - eq[26][i].in[1] <== 93; - and[37][i] = AND(); - and[37][i].a <== states[i][31]; - and[37][i].b <== eq[26][i].out; - lt[0][i] = LessEqThan(8); - lt[0][i].in[0] <== 14; - lt[0][i].in[1] <== in[i]; - lt[1][i] = LessEqThan(8); - lt[1][i].in[0] <== in[i]; - lt[1][i].in[1] <== 127; - and[38][i] = AND(); - and[38][i].a <== lt[0][i].out; - and[38][i].b <== lt[1][i].out; + eq[26][i].in[1] <== 239; + and[25][i] = AND(); + and[25][i].a <== states[i][10]; + multi_or[3][i] = MultiOR(14); + multi_or[3][i].in[0] <== eq[13][i].out; + multi_or[3][i].in[1] <== eq[14][i].out; + multi_or[3][i].in[2] <== eq[15][i].out; + multi_or[3][i].in[3] <== eq[16][i].out; + multi_or[3][i].in[4] <== eq[17][i].out; + multi_or[3][i].in[5] <== eq[18][i].out; + multi_or[3][i].in[6] <== eq[19][i].out; + multi_or[3][i].in[7] <== eq[20][i].out; + multi_or[3][i].in[8] <== eq[21][i].out; + multi_or[3][i].in[9] <== eq[22][i].out; + multi_or[3][i].in[10] <== eq[23][i].out; + multi_or[3][i].in[11] <== eq[24][i].out; + multi_or[3][i].in[12] <== eq[25][i].out; + multi_or[3][i].in[13] <== eq[26][i].out; + and[25][i].b <== multi_or[3][i].out; + lt[12][i] = LessEqThan(8); + lt[12][i].in[0] <== 144; + lt[12][i].in[1] <== in[i]; + lt[13][i] = LessEqThan(8); + lt[13][i].in[0] <== in[i]; + lt[13][i].in[1] <== 191; + and[26][i] = AND(); + and[26][i].a <== lt[12][i].out; + and[26][i].b <== lt[13][i].out; + and[27][i] = AND(); + and[27][i].a <== states[i][16]; + and[27][i].b <== and[26][i].out; + and[28][i] = AND(); + and[28][i].a <== states[i][17]; + and[28][i].b <== and[14][i].out; eq[27][i] = IsEqual(); eq[27][i].in[0] <== in[i]; - eq[27][i].in[1] <== 1; + eq[27][i].in[1] <== 128; eq[28][i] = IsEqual(); eq[28][i].in[0] <== in[i]; - eq[28][i].in[1] <== 2; + eq[28][i].in[1] <== 129; eq[29][i] = IsEqual(); eq[29][i].in[0] <== in[i]; - eq[29][i].in[1] <== 3; + eq[29][i].in[1] <== 130; eq[30][i] = IsEqual(); eq[30][i].in[0] <== in[i]; - eq[30][i].in[1] <== 4; + eq[30][i].in[1] <== 131; eq[31][i] = IsEqual(); eq[31][i].in[0] <== in[i]; - eq[31][i].in[1] <== 5; + eq[31][i].in[1] <== 132; eq[32][i] = IsEqual(); eq[32][i].in[0] <== in[i]; - eq[32][i].in[1] <== 6; + eq[32][i].in[1] <== 133; eq[33][i] = IsEqual(); eq[33][i].in[0] <== in[i]; - eq[33][i].in[1] <== 7; + eq[33][i].in[1] <== 134; eq[34][i] = IsEqual(); eq[34][i].in[0] <== in[i]; - eq[34][i].in[1] <== 8; + eq[34][i].in[1] <== 135; eq[35][i] = IsEqual(); eq[35][i].in[0] <== in[i]; - eq[35][i].in[1] <== 9; + eq[35][i].in[1] <== 136; eq[36][i] = IsEqual(); eq[36][i].in[0] <== in[i]; - eq[36][i].in[1] <== 11; + eq[36][i].in[1] <== 137; eq[37][i] = IsEqual(); eq[37][i].in[0] <== in[i]; - eq[37][i].in[1] <== 12; - and[39][i] = AND(); - and[39][i].a <== states[i][32]; - multi_or[4][i] = MultiOR(12); - multi_or[4][i].in[0] <== and[38][i].out; - multi_or[4][i].in[1] <== eq[27][i].out; - multi_or[4][i].in[2] <== eq[28][i].out; - multi_or[4][i].in[3] <== eq[29][i].out; - multi_or[4][i].in[4] <== eq[30][i].out; - multi_or[4][i].in[5] <== eq[31][i].out; - multi_or[4][i].in[6] <== eq[32][i].out; - multi_or[4][i].in[7] <== eq[33][i].out; - multi_or[4][i].in[8] <== eq[34][i].out; - multi_or[4][i].in[9] <== eq[35][i].out; - multi_or[4][i].in[10] <== eq[36][i].out; - multi_or[4][i].in[11] <== eq[37][i].out; - and[39][i].b <== multi_or[4][i].out; - lt[2][i] = LessEqThan(8); - lt[2][i].in[0] <== 128; - lt[2][i].in[1] <== in[i]; - lt[3][i] = LessEqThan(8); - lt[3][i].in[0] <== in[i]; - lt[3][i].in[1] <== 191; - and[40][i] = AND(); - and[40][i].a <== lt[2][i].out; - and[40][i].b <== lt[3][i].out; - and[41][i] = AND(); - and[41][i].a <== states[i][34]; - and[41][i].b <== and[40][i].out; - multi_or[5][i] = MultiOR(3); - multi_or[5][i].in[0] <== and[37][i].out; - multi_or[5][i].in[1] <== and[39][i].out; - multi_or[5][i].in[2] <== and[41][i].out; - states[i+1][32] <== multi_or[5][i].out; - and[42][i] = AND(); - and[42][i].a <== states[i][32]; - and[42][i].b <== eq[0][i].out; - states[i+1][33] <== and[42][i].out; - lt[4][i] = LessEqThan(8); - lt[4][i].in[0] <== 194; - lt[4][i].in[1] <== in[i]; - lt[5][i] = LessEqThan(8); - lt[5][i].in[0] <== in[i]; - lt[5][i].in[1] <== 223; - and[43][i] = AND(); - and[43][i].a <== lt[4][i].out; - and[43][i].b <== lt[5][i].out; - and[44][i] = AND(); - and[44][i].a <== states[i][32]; - and[44][i].b <== and[43][i].out; - lt[6][i] = LessEqThan(8); - lt[6][i].in[0] <== 160; - lt[6][i].in[1] <== in[i]; - lt[7][i] = LessEqThan(8); - lt[7][i].in[0] <== in[i]; - lt[7][i].in[1] <== 191; - and[45][i] = AND(); - and[45][i].a <== lt[6][i].out; - and[45][i].b <== lt[7][i].out; - and[46][i] = AND(); - and[46][i].a <== states[i][35]; - and[46][i].b <== and[45][i].out; - and[47][i] = AND(); - and[47][i].a <== states[i][36]; - and[47][i].b <== and[40][i].out; - lt[8][i] = LessEqThan(8); - lt[8][i].in[0] <== 128; - lt[8][i].in[1] <== in[i]; - lt[9][i] = LessEqThan(8); - lt[9][i].in[0] <== in[i]; - lt[9][i].in[1] <== 159; - and[48][i] = AND(); - and[48][i].a <== lt[8][i].out; - and[48][i].b <== lt[9][i].out; - and[49][i] = AND(); - and[49][i].a <== states[i][37]; - and[49][i].b <== and[48][i].out; - multi_or[6][i] = MultiOR(4); - multi_or[6][i].in[0] <== and[44][i].out; - multi_or[6][i].in[1] <== and[46][i].out; - multi_or[6][i].in[2] <== and[47][i].out; - multi_or[6][i].in[3] <== and[49][i].out; - states[i+1][34] <== multi_or[6][i].out; + eq[37][i].in[1] <== 138; eq[38][i] = IsEqual(); eq[38][i].in[0] <== in[i]; - eq[38][i].in[1] <== 224; - and[50][i] = AND(); - and[50][i].a <== states[i][32]; - and[50][i].b <== eq[38][i].out; - states[i+1][35] <== and[50][i].out; + eq[38][i].in[1] <== 139; eq[39][i] = IsEqual(); eq[39][i].in[0] <== in[i]; - eq[39][i].in[1] <== 225; + eq[39][i].in[1] <== 140; eq[40][i] = IsEqual(); eq[40][i].in[0] <== in[i]; - eq[40][i].in[1] <== 226; + eq[40][i].in[1] <== 141; eq[41][i] = IsEqual(); eq[41][i].in[0] <== in[i]; - eq[41][i].in[1] <== 227; + eq[41][i].in[1] <== 142; eq[42][i] = IsEqual(); eq[42][i].in[0] <== in[i]; - eq[42][i].in[1] <== 228; + eq[42][i].in[1] <== 143; + and[29][i] = AND(); + and[29][i].a <== states[i][18]; + multi_or[4][i] = MultiOR(16); + multi_or[4][i].in[0] <== eq[27][i].out; + multi_or[4][i].in[1] <== eq[28][i].out; + multi_or[4][i].in[2] <== eq[29][i].out; + multi_or[4][i].in[3] <== eq[30][i].out; + multi_or[4][i].in[4] <== eq[31][i].out; + multi_or[4][i].in[5] <== eq[32][i].out; + multi_or[4][i].in[6] <== eq[33][i].out; + multi_or[4][i].in[7] <== eq[34][i].out; + multi_or[4][i].in[8] <== eq[35][i].out; + multi_or[4][i].in[9] <== eq[36][i].out; + multi_or[4][i].in[10] <== eq[37][i].out; + multi_or[4][i].in[11] <== eq[38][i].out; + multi_or[4][i].in[12] <== eq[39][i].out; + multi_or[4][i].in[13] <== eq[40][i].out; + multi_or[4][i].in[14] <== eq[41][i].out; + multi_or[4][i].in[15] <== eq[42][i].out; + and[29][i].b <== multi_or[4][i].out; + multi_or[5][i] = MultiOR(4); + multi_or[5][i].in[0] <== and[25][i].out; + multi_or[5][i].in[1] <== and[27][i].out; + multi_or[5][i].in[2] <== and[28][i].out; + multi_or[5][i].in[3] <== and[29][i].out; + states[i+1][14] <== multi_or[5][i].out; eq[43][i] = IsEqual(); eq[43][i].in[0] <== in[i]; - eq[43][i].in[1] <== 229; + eq[43][i].in[1] <== 237; + and[30][i] = AND(); + and[30][i].a <== states[i][10]; + and[30][i].b <== eq[43][i].out; + states[i+1][15] <== and[30][i].out; eq[44][i] = IsEqual(); eq[44][i].in[0] <== in[i]; - eq[44][i].in[1] <== 230; + eq[44][i].in[1] <== 240; + and[31][i] = AND(); + and[31][i].a <== states[i][10]; + and[31][i].b <== eq[44][i].out; + states[i+1][16] <== and[31][i].out; eq[45][i] = IsEqual(); eq[45][i].in[0] <== in[i]; - eq[45][i].in[1] <== 231; + eq[45][i].in[1] <== 241; eq[46][i] = IsEqual(); eq[46][i].in[0] <== in[i]; - eq[46][i].in[1] <== 232; + eq[46][i].in[1] <== 242; eq[47][i] = IsEqual(); eq[47][i].in[0] <== in[i]; - eq[47][i].in[1] <== 233; + eq[47][i].in[1] <== 243; + and[32][i] = AND(); + and[32][i].a <== states[i][10]; + multi_or[6][i] = MultiOR(3); + multi_or[6][i].in[0] <== eq[45][i].out; + multi_or[6][i].in[1] <== eq[46][i].out; + multi_or[6][i].in[2] <== eq[47][i].out; + and[32][i].b <== multi_or[6][i].out; + states[i+1][17] <== and[32][i].out; eq[48][i] = IsEqual(); eq[48][i].in[0] <== in[i]; - eq[48][i].in[1] <== 234; + eq[48][i].in[1] <== 244; + and[33][i] = AND(); + and[33][i].a <== states[i][10]; + and[33][i].b <== eq[48][i].out; + states[i+1][18] <== and[33][i].out; eq[49][i] = IsEqual(); eq[49][i].in[0] <== in[i]; - eq[49][i].in[1] <== 235; + eq[49][i].in[1] <== 82; + and[34][i] = AND(); + and[34][i].a <== states[i][11]; + and[34][i].b <== eq[49][i].out; + states[i+1][19] <== and[34][i].out; + and[35][i] = AND(); + and[35][i].a <== states[i][19]; + and[35][i].b <== eq[7][i].out; + states[i+1][20] <== and[35][i].out; eq[50][i] = IsEqual(); eq[50][i].in[0] <== in[i]; - eq[50][i].in[1] <== 236; + eq[50][i].in[1] <== 112; + and[36][i] = AND(); + and[36][i].a <== states[i][20]; + and[36][i].b <== eq[50][i].out; + states[i+1][21] <== and[36][i].out; eq[51][i] = IsEqual(); eq[51][i].in[0] <== in[i]; - eq[51][i].in[1] <== 238; + eq[51][i].in[1] <== 108; + and[37][i] = AND(); + and[37][i].a <== states[i][21]; + and[37][i].b <== eq[51][i].out; + states[i+1][22] <== and[37][i].out; eq[52][i] = IsEqual(); eq[52][i].in[0] <== in[i]; - eq[52][i].in[1] <== 239; - and[51][i] = AND(); - and[51][i].a <== states[i][32]; - multi_or[7][i] = MultiOR(14); - multi_or[7][i].in[0] <== eq[39][i].out; - multi_or[7][i].in[1] <== eq[40][i].out; - multi_or[7][i].in[2] <== eq[41][i].out; - multi_or[7][i].in[3] <== eq[42][i].out; - multi_or[7][i].in[4] <== eq[43][i].out; - multi_or[7][i].in[5] <== eq[44][i].out; - multi_or[7][i].in[6] <== eq[45][i].out; - multi_or[7][i].in[7] <== eq[46][i].out; - multi_or[7][i].in[8] <== eq[47][i].out; - multi_or[7][i].in[9] <== eq[48][i].out; - multi_or[7][i].in[10] <== eq[49][i].out; - multi_or[7][i].in[11] <== eq[50][i].out; - multi_or[7][i].in[12] <== eq[51][i].out; - multi_or[7][i].in[13] <== eq[52][i].out; - and[51][i].b <== multi_or[7][i].out; - lt[10][i] = LessEqThan(8); - lt[10][i].in[0] <== 144; - lt[10][i].in[1] <== in[i]; - lt[11][i] = LessEqThan(8); - lt[11][i].in[0] <== in[i]; - lt[11][i].in[1] <== 191; - and[52][i] = AND(); - and[52][i].a <== lt[10][i].out; - and[52][i].b <== lt[11][i].out; - and[53][i] = AND(); - and[53][i].a <== states[i][38]; - and[53][i].b <== and[52][i].out; - and[54][i] = AND(); - and[54][i].a <== states[i][39]; - and[54][i].b <== and[40][i].out; + eq[52][i].in[1] <== 121; + and[38][i] = AND(); + and[38][i].a <== states[i][22]; + and[38][i].b <== eq[52][i].out; + states[i+1][23] <== and[38][i].out; eq[53][i] = IsEqual(); eq[53][i].in[0] <== in[i]; - eq[53][i].in[1] <== 128; + eq[53][i].in[1] <== 32; + and[39][i] = AND(); + and[39][i].a <== states[i][23]; + and[39][i].b <== eq[53][i].out; + states[i+1][24] <== and[39][i].out; eq[54][i] = IsEqual(); eq[54][i].in[0] <== in[i]; - eq[54][i].in[1] <== 129; + eq[54][i].in[1] <== 78; + and[40][i] = AND(); + and[40][i].a <== states[i][24]; + and[40][i].b <== eq[54][i].out; + states[i+1][25] <== and[40][i].out; + and[41][i] = AND(); + and[41][i].a <== states[i][25]; + and[41][i].b <== eq[7][i].out; + states[i+1][26] <== and[41][i].out; + and[42][i] = AND(); + and[42][i].a <== states[i][26]; + and[42][i].b <== eq[7][i].out; + states[i+1][27] <== and[42][i].out; eq[55][i] = IsEqual(); eq[55][i].in[0] <== in[i]; - eq[55][i].in[1] <== 130; + eq[55][i].in[1] <== 100; + and[43][i] = AND(); + and[43][i].a <== states[i][27]; + and[43][i].b <== eq[55][i].out; + states[i+1][28] <== and[43][i].out; + and[44][i] = AND(); + and[44][i].a <== states[i][28]; + and[44][i].b <== eq[7][i].out; + states[i+1][29] <== and[44][i].out; + and[45][i] = AND(); + and[45][i].a <== states[i][29]; + and[45][i].b <== eq[55][i].out; + states[i+1][30] <== and[45][i].out; eq[56][i] = IsEqual(); eq[56][i].in[0] <== in[i]; - eq[56][i].in[1] <== 131; + eq[56][i].in[1] <== 93; + and[46][i] = AND(); + and[46][i].a <== states[i][30]; + and[46][i].b <== eq[56][i].out; + lt[14][i] = LessEqThan(8); + lt[14][i].in[0] <== 14; + lt[14][i].in[1] <== in[i]; + lt[15][i] = LessEqThan(8); + lt[15][i].in[0] <== in[i]; + lt[15][i].in[1] <== 127; + and[47][i] = AND(); + and[47][i].a <== lt[14][i].out; + and[47][i].b <== lt[15][i].out; eq[57][i] = IsEqual(); eq[57][i].in[0] <== in[i]; - eq[57][i].in[1] <== 132; + eq[57][i].in[1] <== 1; eq[58][i] = IsEqual(); eq[58][i].in[0] <== in[i]; - eq[58][i].in[1] <== 133; + eq[58][i].in[1] <== 2; eq[59][i] = IsEqual(); eq[59][i].in[0] <== in[i]; - eq[59][i].in[1] <== 134; + eq[59][i].in[1] <== 3; eq[60][i] = IsEqual(); eq[60][i].in[0] <== in[i]; - eq[60][i].in[1] <== 135; + eq[60][i].in[1] <== 4; eq[61][i] = IsEqual(); eq[61][i].in[0] <== in[i]; - eq[61][i].in[1] <== 136; + eq[61][i].in[1] <== 5; eq[62][i] = IsEqual(); eq[62][i].in[0] <== in[i]; - eq[62][i].in[1] <== 137; + eq[62][i].in[1] <== 6; eq[63][i] = IsEqual(); eq[63][i].in[0] <== in[i]; - eq[63][i].in[1] <== 138; + eq[63][i].in[1] <== 7; eq[64][i] = IsEqual(); eq[64][i].in[0] <== in[i]; - eq[64][i].in[1] <== 139; + eq[64][i].in[1] <== 8; eq[65][i] = IsEqual(); eq[65][i].in[0] <== in[i]; - eq[65][i].in[1] <== 140; + eq[65][i].in[1] <== 9; eq[66][i] = IsEqual(); eq[66][i].in[0] <== in[i]; - eq[66][i].in[1] <== 141; + eq[66][i].in[1] <== 11; eq[67][i] = IsEqual(); eq[67][i].in[0] <== in[i]; - eq[67][i].in[1] <== 142; - eq[68][i] = IsEqual(); - eq[68][i].in[0] <== in[i]; - eq[68][i].in[1] <== 143; - and[55][i] = AND(); - and[55][i].a <== states[i][40]; - multi_or[8][i] = MultiOR(16); - multi_or[8][i].in[0] <== eq[53][i].out; - multi_or[8][i].in[1] <== eq[54][i].out; - multi_or[8][i].in[2] <== eq[55][i].out; - multi_or[8][i].in[3] <== eq[56][i].out; - multi_or[8][i].in[4] <== eq[57][i].out; - multi_or[8][i].in[5] <== eq[58][i].out; - multi_or[8][i].in[6] <== eq[59][i].out; - multi_or[8][i].in[7] <== eq[60][i].out; - multi_or[8][i].in[8] <== eq[61][i].out; - multi_or[8][i].in[9] <== eq[62][i].out; - multi_or[8][i].in[10] <== eq[63][i].out; - multi_or[8][i].in[11] <== eq[64][i].out; - multi_or[8][i].in[12] <== eq[65][i].out; - multi_or[8][i].in[13] <== eq[66][i].out; - multi_or[8][i].in[14] <== eq[67][i].out; - multi_or[8][i].in[15] <== eq[68][i].out; - and[55][i].b <== multi_or[8][i].out; + eq[67][i].in[1] <== 12; + and[48][i] = AND(); + and[48][i].a <== states[i][31]; + multi_or[7][i] = MultiOR(12); + multi_or[7][i].in[0] <== and[47][i].out; + multi_or[7][i].in[1] <== eq[57][i].out; + multi_or[7][i].in[2] <== eq[58][i].out; + multi_or[7][i].in[3] <== eq[59][i].out; + multi_or[7][i].in[4] <== eq[60][i].out; + multi_or[7][i].in[5] <== eq[61][i].out; + multi_or[7][i].in[6] <== eq[62][i].out; + multi_or[7][i].in[7] <== eq[63][i].out; + multi_or[7][i].in[8] <== eq[64][i].out; + multi_or[7][i].in[9] <== eq[65][i].out; + multi_or[7][i].in[10] <== eq[66][i].out; + multi_or[7][i].in[11] <== eq[67][i].out; + and[48][i].b <== multi_or[7][i].out; + and[49][i] = AND(); + and[49][i].a <== states[i][33]; + and[49][i].b <== and[14][i].out; + multi_or[8][i] = MultiOR(3); + multi_or[8][i].in[0] <== and[46][i].out; + multi_or[8][i].in[1] <== and[48][i].out; + multi_or[8][i].in[2] <== and[49][i].out; + states[i+1][31] <== multi_or[8][i].out; + and[50][i] = AND(); + and[50][i].a <== states[i][31]; + and[50][i].b <== eq[0][i].out; + states[i+1][32] <== and[50][i].out; + and[51][i] = AND(); + and[51][i].a <== states[i][31]; + and[51][i].b <== and[17][i].out; + and[52][i] = AND(); + and[52][i].a <== states[i][34]; + and[52][i].b <== and[19][i].out; + and[53][i] = AND(); + and[53][i].a <== states[i][35]; + and[53][i].b <== and[14][i].out; + and[54][i] = AND(); + and[54][i].a <== states[i][36]; + and[54][i].b <== and[22][i].out; multi_or[9][i] = MultiOR(4); multi_or[9][i].in[0] <== and[51][i].out; - multi_or[9][i].in[1] <== and[53][i].out; - multi_or[9][i].in[2] <== and[54][i].out; - multi_or[9][i].in[3] <== and[55][i].out; - states[i+1][36] <== multi_or[9][i].out; - eq[69][i] = IsEqual(); - eq[69][i].in[0] <== in[i]; - eq[69][i].in[1] <== 237; + multi_or[9][i].in[1] <== and[52][i].out; + multi_or[9][i].in[2] <== and[53][i].out; + multi_or[9][i].in[3] <== and[54][i].out; + states[i+1][33] <== multi_or[9][i].out; + and[55][i] = AND(); + and[55][i].a <== states[i][31]; + and[55][i].b <== eq[12][i].out; + states[i+1][34] <== and[55][i].out; and[56][i] = AND(); - and[56][i].a <== states[i][32]; - and[56][i].b <== eq[69][i].out; - states[i+1][37] <== and[56][i].out; - eq[70][i] = IsEqual(); - eq[70][i].in[0] <== in[i]; - eq[70][i].in[1] <== 240; + and[56][i].a <== states[i][31]; + and[56][i].b <== multi_or[3][i].out; and[57][i] = AND(); - and[57][i].a <== states[i][32]; - and[57][i].b <== eq[70][i].out; - states[i+1][38] <== and[57][i].out; - eq[71][i] = IsEqual(); - eq[71][i].in[0] <== in[i]; - eq[71][i].in[1] <== 241; - eq[72][i] = IsEqual(); - eq[72][i].in[0] <== in[i]; - eq[72][i].in[1] <== 242; - eq[73][i] = IsEqual(); - eq[73][i].in[0] <== in[i]; - eq[73][i].in[1] <== 243; + and[57][i].a <== states[i][37]; + and[57][i].b <== and[26][i].out; and[58][i] = AND(); - and[58][i].a <== states[i][32]; - multi_or[10][i] = MultiOR(3); - multi_or[10][i].in[0] <== eq[71][i].out; - multi_or[10][i].in[1] <== eq[72][i].out; - multi_or[10][i].in[2] <== eq[73][i].out; - and[58][i].b <== multi_or[10][i].out; - states[i+1][39] <== and[58][i].out; - eq[74][i] = IsEqual(); - eq[74][i].in[0] <== in[i]; - eq[74][i].in[1] <== 244; + and[58][i].a <== states[i][38]; + and[58][i].b <== and[14][i].out; and[59][i] = AND(); - and[59][i].a <== states[i][32]; - and[59][i].b <== eq[74][i].out; - states[i+1][40] <== and[59][i].out; + and[59][i].a <== states[i][39]; + and[59][i].b <== multi_or[4][i].out; + multi_or[10][i] = MultiOR(4); + multi_or[10][i].in[0] <== and[56][i].out; + multi_or[10][i].in[1] <== and[57][i].out; + multi_or[10][i].in[2] <== and[58][i].out; + multi_or[10][i].in[3] <== and[59][i].out; + states[i+1][35] <== multi_or[10][i].out; and[60][i] = AND(); - and[60][i].a <== states[i][33]; - and[60][i].b <== eq[2][i].out; - states[i+1][41] <== and[60][i].out; - from_zero_enabled[i] <== MultiNOR(41)([states_tmp[i+1][1], states_tmp[i+1][2], states[i+1][3], states[i+1][4], states[i+1][5], states[i+1][6], states[i+1][7], states[i+1][8], states[i+1][9], states[i+1][10], states[i+1][11], states[i+1][12], states[i+1][13], states[i+1][14], states[i+1][15], states[i+1][16], states[i+1][17], states[i+1][18], states[i+1][19], states[i+1][20], states[i+1][21], states[i+1][22], states[i+1][23], states[i+1][24], states[i+1][25], states[i+1][26], states[i+1][27], states[i+1][28], states[i+1][29], states[i+1][30], states[i+1][31], states[i+1][32], states[i+1][33], states[i+1][34], states[i+1][35], states[i+1][36], states[i+1][37], states[i+1][38], states[i+1][39], states[i+1][40], states[i+1][41]]); + and[60][i].a <== states[i][31]; + and[60][i].b <== eq[43][i].out; + states[i+1][36] <== and[60][i].out; + and[61][i] = AND(); + and[61][i].a <== states[i][31]; + and[61][i].b <== eq[44][i].out; + states[i+1][37] <== and[61][i].out; + and[62][i] = AND(); + and[62][i].a <== states[i][31]; + and[62][i].b <== multi_or[6][i].out; + states[i+1][38] <== and[62][i].out; + and[63][i] = AND(); + and[63][i].a <== states[i][31]; + and[63][i].b <== eq[48][i].out; + states[i+1][39] <== and[63][i].out; + and[64][i] = AND(); + and[64][i].a <== states[i][32]; + and[64][i].b <== eq[2][i].out; + states[i+1][40] <== and[64][i].out; + from_zero_enabled[i] <== MultiNOR(40)([states_tmp[i+1][1], states_tmp[i+1][2], states[i+1][3], states[i+1][4], states[i+1][5], states[i+1][6], states[i+1][7], states[i+1][8], states[i+1][9], states[i+1][10], states[i+1][11], states[i+1][12], states[i+1][13], states[i+1][14], states[i+1][15], states[i+1][16], states[i+1][17], states[i+1][18], states[i+1][19], states[i+1][20], states[i+1][21], states[i+1][22], states[i+1][23], states[i+1][24], states[i+1][25], states[i+1][26], states[i+1][27], states[i+1][28], states[i+1][29], states[i+1][30], states[i+1][31], states[i+1][32], states[i+1][33], states[i+1][34], states[i+1][35], states[i+1][36], states[i+1][37], states[i+1][38], states[i+1][39], states[i+1][40]]); states[i+1][1] <== MultiOR(2)([states_tmp[i+1][1], from_zero_enabled[i] * and[0][i].out]); states[i+1][2] <== MultiOR(2)([states_tmp[i+1][2], from_zero_enabled[i] * and[1][i].out]); state_changed[i].in[0] <== states[i+1][1]; @@ -639,20 +644,19 @@ template ForcedSubjectRegex(msg_bytes) { state_changed[i].in[37] <== states[i+1][38]; state_changed[i].in[38] <== states[i+1][39]; state_changed[i].in[39] <== states[i+1][40]; - state_changed[i].in[40] <== states[i+1][41]; } component is_accepted = MultiOR(num_bytes+1); for (var i = 0; i <= num_bytes; i++) { - is_accepted.in[i] <== states[i][41]; + is_accepted.in[i] <== states[i][40]; } out <== is_accepted.out; signal is_consecutive[msg_bytes+1][3]; is_consecutive[msg_bytes][2] <== 0; for (var i = 0; i < msg_bytes; i++) { - is_consecutive[msg_bytes-1-i][0] <== states[num_bytes-i][41] * (1 - is_consecutive[msg_bytes-i][2]) + is_consecutive[msg_bytes-i][2]; + is_consecutive[msg_bytes-1-i][0] <== states[num_bytes-i][40] * (1 - is_consecutive[msg_bytes-i][2]) + is_consecutive[msg_bytes-i][2]; is_consecutive[msg_bytes-1-i][1] <== state_changed[msg_bytes-i].out * is_consecutive[msg_bytes-1-i][0]; - is_consecutive[msg_bytes-1-i][2] <== ORAnd()([(1 - from_zero_enabled[msg_bytes-i+1]), states[num_bytes-i][41], is_consecutive[msg_bytes-1-i][1]]); + is_consecutive[msg_bytes-1-i][2] <== ORAnd()([(1 - from_zero_enabled[msg_bytes-i+1]), states[num_bytes-i][40], is_consecutive[msg_bytes-1-i][1]]); } // substrings calculated: [] } \ No newline at end of file diff --git a/packages/circuits/tests/emails/recovery_icloud_english_pc.eml b/packages/circuits/tests/emails/recovery_icloud_english_pc.eml new file mode 100644 index 0000000..57066ab --- /dev/null +++ b/packages/circuits/tests/emails/recovery_icloud_english_pc.eml @@ -0,0 +1,187 @@ +Delivered-To: arbitrum@sendeth.org +Received: by 2002:a05:7301:9a91:b0:150:7837:3792 with SMTP id og17csp2122071dyc; + Sun, 8 Dec 2024 23:43:45 -0800 (PST) +X-Google-Smtp-Source: AGHT+IECYfKpqMvKW1+Z9Vm01ZTNYHYDN7x+g1iKhFPzc3vrFQMor2EU6Uc0QR2qUo5Tab7xLSqC +X-Received: by 2002:a17:90b:38a:b0:2ee:463d:8e8d with SMTP id 98e67ed59e1d1-2ef41c71cd2mr10254656a91.14.1733730224648; + Sun, 08 Dec 2024 23:43:44 -0800 (PST) +ARC-Seal: i=1; a=rsa-sha256; t=1733730224; cv=none; + d=google.com; s=arc-20240605; + b=Q+2FlZMzBU+X8iAggvjzMrIzkfQEYOfD/CP2siT0Vyu9RKsDgp5+IN8d3lYynruB2/ + LzK0W/E58uqTBb0T472yFYcH6+QwhzaR+SQMxVUsJpX4thdOlKmziu54ziP18L5LTBuY + 8uueUSGKA5VslrT3tFYRU7lkXkvTJAy/ZHRpG3DWTSCrgDy2bMDvg9EaxGgIaWSqnboP + 4xeT7TW69lY+bw1PAPkzTfsvzbwSyE+eR1YX+IkiHaFBXb927Kz1+BMnlCo1ovlnThBS + 67Kw9IOHyi6bFRJW0la7sapYSSYhupzMtI1N3NxWxQO3MVREacRXGGb21rWlY4p6qaXk + OlLA== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; + h=references:in-reply-to:mime-version:message-id:date:subject:from:to + :dkim-signature; + bh=ok1sZqWcNorB1hUrcEZ8bpWOro4GHrYvhkYAc5NFIpI=; + fh=NiFfXpGsf4NiPgQyu56KYLs/TS2Vqsd4I8WrbqKeOhg=; + b=cutz/ycY5qst163sG55M+ROKmZo9yMTlcI+ay15A9FGnJI2IgwBen1TA8lQeNHI7Pe + D8xsbTo9KVVr1mcIrWueqSoEeOQhOowkfNWVPb8dZY/DxI9KVzjC3GW9TZhTlJGBK+RU + zXpB1IGota789HJrTmdWzS7VMrgb8Y3Y4QeeyI59nyJx4e7JMx7cTrAiE8apgUAiqPZ2 + iCWP0cKD+pUZkkMZifGPLDft+W8PX4vFZIgCwjxRKCN7hYO+WpL/2Fcs+t9PbzFtzh0O + A4u1VTjKsbulHulYpqhVpNE6JymqwIzZBMFqO0ifbXkDq+bz1hOX7U4dilbU1R9i+yIg + KKTw==; + dara=google.com +ARC-Authentication-Results: i=1; mx.google.com; + dkim=pass header.i=@icloud.com header.s=1a1hai header.b=hGsg5cRU; + spf=pass (google.com: domain of suegamisora@icloud.com designates 17.58.23.181 as permitted sender) smtp.mailfrom=suegamisora@icloud.com; + dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=icloud.com +Return-Path: +Received: from mr85p00im-ztdg06011201.me.com (mr85p00im-ztdg06011201.me.com. [17.58.23.181]) + by mx.google.com with ESMTPS id 98e67ed59e1d1-2ef27085fbdsi13082749a91.84.2024.12.08.23.43.44 + for + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Sun, 08 Dec 2024 23:43:44 -0800 (PST) +Received-SPF: pass (google.com: domain of suegamisora@icloud.com designates 17.58.23.181 as permitted sender) client-ip=17.58.23.181; +Authentication-Results: mx.google.com; + dkim=pass header.i=@icloud.com header.s=1a1hai header.b=hGsg5cRU; + spf=pass (google.com: domain of suegamisora@icloud.com designates 17.58.23.181 as permitted sender) smtp.mailfrom=suegamisora@icloud.com; + dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=icloud.com +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; + s=1a1hai; t=1733730223; + bh=ok1sZqWcNorB1hUrcEZ8bpWOro4GHrYvhkYAc5NFIpI=; + h=To:From:Subject:Date:Message-id:Content-Type:MIME-Version: + x-icloud-hme; + b=hGsg5cRUfNBlh+7TymMjW/UYucthWdWb+zzswiTt1P8CC0vSV2fcw4vC6VeufdlgT + gGkEJMydr596K1yC71WCc6sbUpq5qEipeIf084QhRWf3PhJ57+Gh2K2ga8VGMP61mJ + muhmn1t40SjjMYtnCvuEoFoDTWo2i7Zgist/UQoA8yjZoZGQ8Vv0rXO1vjAOQmBSuN + 61aQyqdgag+4bxqvh6+SToGKPmpgbVgjjQgCD5uWbdST/WgxmBgHPBNpJyfB2xVl+w + CfV0ypj7RjXwcJuB2qhYXXKdtPGrJoon5ydRB5pNBalbpw4ckZH0iikep7nLqLzH+4 + eNreEo8N02cRA== +Received: from mr85p00im-ztdg06011201.me.com (mr85p00im-ztdg06011201.me.com [17.58.23.181]) + by mr85p00im-ztdg06011201.me.com (Postfix) with ESMTPS id 28B07960297 + for ; Mon, 9 Dec 2024 07:43:41 +0000 (UTC) +Received: from p00-mailws2-5b95964b8d-lv8dl (mr38p00im.dlb-asmtpoutvip.me.com [10.112.84.233]) + by mr85p00im-ztdg06011201.me.com (Postfix) with ESMTPSA id 2A841960241 + for ; Mon, 9 Dec 2024 07:43:41 +0000 (UTC) +To: arbitrum@sendeth.org +From: =?utf-8?B?5pyr56We5aWP5a6Z?= +Subject: Re: [Reply Needed] Recovery: Acceptance Request +Date: Mon, 9 Dec 2024 07:43:41 +0000 (UTC) +X-Mailer: iCloud MailClientcurrent MailServer2429B28.6954931b110c +Message-id: <1e32b6dc-218f-4076-a7b1-c7d64983496c@me.com> +Content-Type: multipart/alternative; boundary=Apple-Webmail-42--b896184a-a8b2-41f4-ae46-b14da7197c22 +MIME-Version: 1.0 +In-Reply-To: +References: +X-Proofpoint-ORIG-GUID: kKigxBX8JuT1FwIGMcIwhZcDYJLmDFuC +X-Proofpoint-GUID: kKigxBX8JuT1FwIGMcIwhZcDYJLmDFuC +X-Proofpoint-Virus-Version: vendor=baseguard + engine=ICAP:2.0.272,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 + definitions=2024-12-09_04,2024-12-09_01,2024-11-22_01 +X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 + phishscore=0 clxscore=1011 malwarescore=0 mlxscore=0 spamscore=0 + suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx + scancount=1 engine=8.19.0-2308100000 definitions=main-2412090059 + + +--Apple-Webmail-42--b896184a-a8b2-41f4-ae46-b14da7197c22 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; + charset=utf-8; + format=flowed + +2024=E5=B9=B412=E6=9C=889=E6=97=A5 16:43=E3=80=81arbitrum@sendeth.org=E3=81= +=8B=E3=82=89=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF=BC=9A Hi, suegamisora@= +icloud.com ! You have received an guardian request from the wallet address= + 0xccbef71b57c85e7f12700b7d831267d893904fbe . Reply " Confirm " to this em= +ail to accept the request. Your request ID is #1855412348. If you did not = +initiate this request, please contact us immediately. Cheers, The ZK Email= + Team Powered by ZK Email Accept guardian request for 0xcCBef71b57C85E7F12= +700B7D831267D893904fbE Code 1162ebff40918afe5305e68396f0283eb675901d0387f9= +7d21928d423aaa0b20 +--Apple-Webmail-42--b896184a-a8b2-41f4-ae46-b14da7197c22 +Content-Type: multipart/related; + type="text/html"; + boundary=Apple-Webmail-86--b896184a-a8b2-41f4-ae46-b14da7197c22 + + +--Apple-Webmail-86--b896184a-a8b2-41f4-ae46-b14da7197c22 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; + charset=utf-8; + +


2024=E5=B9= +=B412=E6=9C=889=E6=97=A5 16:43=E3=80=81arbitrum@sendeth.org=E3=81=8B=E3=82= +=89=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF=BC=9A

<= +div>
= +
<= +/tr>
Hi, suegamisora@iclo= +ud.com!
You have received an guardian request from= + the wallet address 0xccbef71b57c85e7f12700b7d831267d893904fbe. Rep= +ly "Confirm" to this email to accept the request.=0A = + Your request ID is #1855412348.

If you did= + not initiate this request, please contact us immediately.

Ch= +eers,
The ZK Email Team

Powered by ZK Email

= +
3D"GitHub
3D"Twitter
3D"Telegram
3D"Discord
Accept guardian request for 0xcCBef71b57C85E7F12700B7D831267D= +893904fbE Code 1162ebff40918afe5305e68396f0283eb675901d0387f97d21928d423aa= +a0b20
+--Apple-Webmail-86--b896184a-a8b2-41f4-ae46-b14da7197c22-- + +--Apple-Webmail-42--b896184a-a8b2-41f4-ae46-b14da7197c22-- + diff --git a/yarn.lock b/yarn.lock index b990bfe..5924478 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1729,7 +1729,15 @@ resolved "https://registry.yarnpkg.com/@zk-email/relayer-utils/-/relayer-utils-0.4.59.tgz#a57b540fa3cf603b3d9d89624d9994e44453bb91" integrity sha512-pSKCH/wYuI54Ci5L13md8LNQbwrulQ+HWUyjoiKFH3VtI/NebR98n2JOBvnVHmvpnXfi/l/uimoHnHFD+MOX6A== -"@zk-email/zk-regex-circom@=2.3.1", "@zk-email/zk-regex-circom@^2.3.1": +"@zk-email/zk-regex-circom@=2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@zk-email/zk-regex-circom/-/zk-regex-circom-2.3.2.tgz#d3ad819ea0de3ce7612aa9ecde0497c3fac514fc" + integrity sha512-GXp4Z/93iF54hfJwlWl52HFiqpmLCeSHFc4HlYpxj5EWHQK6ibFQMLUWTJsdA3eh/erjO4UX+HlEIJ/gHhLg9g== + dependencies: + commander "^11.0.0" + snarkjs "^0.7.5" + +"@zk-email/zk-regex-circom@^2.3.1": version "2.3.1" resolved "https://registry.yarnpkg.com/@zk-email/zk-regex-circom/-/zk-regex-circom-2.3.1.tgz#032cdf12b5f587f828d6e872a235c0120d463bc8" integrity sha512-FJNi4QL07teQPuXV4EZqosPpA4riOSeFX2xD+cd4CCuf5b1RmqGqXoBz7yxT0QXuwNqdgooY6v6/xhH1o4X7vg==