A provable AES-128 implementation using o1js.
- Summary
- Features
- Installation
- Build
- Formatting and Linting
- Testing
- Circuit Breakdown
- Contributing
- License
- Additional Information
Mina AES is a community-driven AES-128 implementation built with o1js. It offers a verifiable approach to symmetric encryption, with documentation available here.
This work was spawned from the Mina Grant Starter Program and aims to provide a provable AES implementation, enabling users to generate proofs that they have encrypted or decrypted texts with a corresponding key (which is kept secret).
- AES-128 encryption
- Static and dynamic message sizes
- Counter Mode (CTR)
- Galois Counter Mode (GCM) (coming soon)
npm ci
npm run build
npm run start
Or if you want to use the dev build
npm run dev
npm run lint
npm run format
Unit tests:
npm run test
If you want to test zk programs locally as well:
npm run test:zk
To run a summary of constraints in all library functions:
npm run build
node ./build/test/circuitSummary.js
Key | Value |
---|---|
Total rows | 50185 |
Generic | 18617 |
Xor16 | 10984 |
Zero | 10984 |
Rot64 | 4800 |
RangeCheck0 | 4800 |
- Implementing block mode: Counter Mode (CTR).
- User authentication block mode: Galois Counter Mode (GCM).
Everyone is welcome to contribute, file an issue or submit a pull request if you think there is something worth mentioning.
This project is licensed under the Apache 2.0 License.
Note that although this code has been tested for correctness, no official audit has been performed to test for implementation vulnerabilities. Please do be careful if using this in your applications.