Skip to content

Commit

Permalink
Optimize regex circuits by processing on UInt8 bytes & Adapt changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shigoto-dev19 committed May 7, 2024
1 parent 758ba99 commit 1e45de3
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 109 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ By leveraging ZK Regex, developers can securely verify the presence of specific
1. Start by providing a raw or parsed (expanded) regex pattern, then execute the following command:

```sh
npm run zk-regex '<input>'
npm run zk-regex '<regexPattern>'
```

**NOTE:** `countEnabled` and `substringEnabled` arguments are set to **false** by default.

2. In your TypeScript file, import the necessary modules at the top:

```typescript
import { Field, Bool } from 'o1js';
import { Field, Bool, UInt8 } from 'o1js';
```
3. Add the function body and paste your specific ZK Regex circuit code.
Expand Down Expand Up @@ -115,6 +115,12 @@ npm run testw # watch mode
npm run coverage
```
## How to run zkApp example
```sh
npm run zkapp
```
## Raw Regex Syntax Guide
- **Alteration:** The | character can be used to denote alternation between two expressions. For example: A|B.
Expand Down Expand Up @@ -182,6 +188,8 @@ For more details, you can visit this amazing [ZK Regex Tools](https://zkregex.co
- A huge thanks to the [zkemail](https://github.com/zkemail) team for their magnificent work on the original [zk-regex](https://github.com/zkemail/zk-regex), which inspired and aided in the development of this project. Their reference materials and documentation were invaluable in understanding the technical intricacies.
- Special thanks to [Gregor Mitscha-Baude](https://twitter.com/mitschabaude) for identifying the inefficiency in processing full field elements. This change significantly improved the efficiency of the o1js-regex circuits.
## License
[Apache-2.0](LICENSE)
Binary file modified images/alpha-low-zk-regex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1e45de3

Please sign in to comment.