Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

BLS12-381 signature verification #2106

Merged
merged 80 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
1923d03
Add bls12_318_aggregate_g1/bls12_318_aggregate_g2
webmaster128 Mar 21, 2024
1e26796
Regenerate lockfiles
aumetra Apr 2, 2024
1a13179
Implement pairing functions, and a fast pairing equality function
aumetra Apr 2, 2024
685af55
Pre-allocate storage for terms
aumetra Apr 2, 2024
239a6b6
Add pairing equality tests
aumetra Apr 2, 2024
034cd0b
Test aggregated validation
aumetra Apr 2, 2024
de533a1
Remove generic parameters from hashing to the subgroups
aumetra Apr 3, 2024
bd4eead
Convert to byte-based API
aumetra Apr 4, 2024
2c742eb
Fix compile errors
aumetra Apr 10, 2024
7cf3043
Add CI step for crypto without default features
aumetra Apr 10, 2024
a915beb
Add BLS verify tests
aumetra Apr 10, 2024
1a23904
test hash to g2
aumetra Apr 10, 2024
a69e769
Add fast aggregate verify
aumetra Apr 10, 2024
ede9b65
Add aggregate verify tests
aumetra Apr 10, 2024
756b149
Add batch verify test
aumetra Apr 10, 2024
323a8c4
Fix import warnings
aumetra Apr 10, 2024
83312c0
Replace `.inspect_err` with `.map_err`
aumetra Apr 10, 2024
5d676c2
Fix aggregate verify
aumetra Apr 12, 2024
316f60d
Remove batch verify test for now
aumetra Apr 12, 2024
d6faff7
Attach functions to the VM
aumetra Apr 15, 2024
e3b63de
Write up API functions
aumetra Apr 15, 2024
9c86f93
Fix imports errors
aumetra Apr 15, 2024
7ec4d30
Add supported imports
aumetra Apr 15, 2024
2e3fc32
Vendor own version of `HashFunction`
aumetra Apr 15, 2024
d57682e
Use primitive casts
aumetra Apr 15, 2024
a948c89
Implement more fine-grained errors for aggregation pairing equality
aumetra Apr 16, 2024
eccdd4b
Add cases for empty lists
aumetra Apr 16, 2024
8901589
Bench hash-to-curve and meter gas usage
aumetra Apr 16, 2024
ae268f2
Add pairing equality test to crypto-verify contract
aumetra Apr 16, 2024
4489610
Move to arkworks BLS implementation
aumetra Apr 16, 2024
1d7eb3a
Use assembly feature
aumetra Apr 16, 2024
2a89b9e
Readjust gas values
aumetra Apr 16, 2024
388e9eb
Remove unused impls
aumetra Apr 16, 2024
81ddc81
Add benches for aggregation
aumetra Apr 16, 2024
737b2ee
Add hash-to-curve tests
aumetra Apr 17, 2024
7c6e8d9
Add generator tests
aumetra Apr 17, 2024
d8bfc22
Revert test change
aumetra Apr 17, 2024
305f8ae
Add error tests
aumetra Apr 17, 2024
3c8c7be
Add some mock testing
aumetra Apr 17, 2024
9f04d53
Add aggregate pairing equality test
aumetra Apr 17, 2024
317e770
Add metered cost for aggregation
aumetra Apr 17, 2024
70e33a9
Adjust gas metering for aggregated pairing equality
aumetra Apr 17, 2024
8c3cbec
Add aggregation test for G1 elements
aumetra Apr 17, 2024
6cb0951
Add Changelog entry
aumetra Apr 19, 2024
a32aab9
Add benchmark for aggregated pairing equality
aumetra Apr 22, 2024
5101142
Adjust gas values to represent it more accurately
aumetra Apr 22, 2024
8ce5ad9
Add BLS branch to benchmarking filter
aumetra Apr 22, 2024
7ff01ec
Run crypto benchmarks with std feature
aumetra Apr 22, 2024
f343af0
Remove raw `pairing_equality` function
aumetra Apr 29, 2024
bee4435
Remove par_bridge usage
aumetra Apr 30, 2024
4552450
Adjust gas values
aumetra Apr 30, 2024
edf41e3
Specific error cases on point aggregation
aumetra Apr 30, 2024
554c4eb
Re-export error type
aumetra Apr 30, 2024
19e088b
Make `g1/g2_sum` private
aumetra Apr 30, 2024
bd7018a
Update contracts/crypto-verify/tests/integration.rs
aumetra May 2, 2024
020e2f7
Rename aggregate_pairing_equality -> pairing_equality
webmaster128 May 2, 2024
3597b14
Feature-gate imports
webmaster128 May 2, 2024
120c83b
Add bls12_381_pairing_equality docs
webmaster128 May 2, 2024
ceb3aa7
Fix contract tests
aumetra May 2, 2024
d044e83
Export constants
aumetra May 2, 2024
04fa77e
Add `.unwrap()` disclaimer
aumetra May 2, 2024
5b3cd75
Fix compile-error on WASM
aumetra May 2, 2024
902f399
Update lockfiles
aumetra May 2, 2024
97cfbbb
Refactor contract tests
aumetra May 2, 2024
57aaf8c
Update CHANGELOG.md
aumetra May 7, 2024
6784a00
Replace `.clone_from_slice` with `.copy_from_slice`
aumetra May 7, 2024
f7814dd
Update packages/crypto/src/bls12_318/hash.rs
aumetra May 7, 2024
68bea24
Move constants, add sources
aumetra May 7, 2024
177c9c3
Add generator tests
aumetra May 7, 2024
34afd26
Remove _COMPRESSED from BLS points
webmaster128 May 7, 2024
bcfae4f
Add docs and clarifications to verify_g1/verify_g2
webmaster128 May 7, 2024
2b0a7e3
Remove ark-bls12-381 from crypto-verify contract
webmaster128 May 7, 2024
871c63f
Gate tests behind `std` feature
aumetra May 7, 2024
246ce02
Constants for success
aumetra May 7, 2024
fc70c3e
Remove error checks about empty pairing equality
aumetra May 7, 2024
1bcf5b0
Document bitwise OR operation
aumetra May 10, 2024
2eb1b92
Adjust gas values, move out variables
aumetra May 10, 2024
e326ea8
Port to new region system
aumetra May 10, 2024
62df0e2
Add test pairing_equality_works_for_empty_lhs
webmaster128 May 10, 2024
add97a0
Merge pull request #2142 from CosmWasm/pairing_equality_works_for_emp…
aumetra May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ workflows:
- main
- /^[0-9]+\.[0-9]+$/
# Add your branch here if benchmarking matters to your work
- bls12_381
- secp256r1-support
- coverage
deploy:
Expand Down Expand Up @@ -248,13 +249,17 @@ jobs:
keys:
- cargocache-v2-package_crypto-rust:1.73-{{ checksum "Cargo.lock" }}
- run:
name: Build
name: Build (no features)
working_directory: ~/project/packages/crypto
command: cargo build --locked
command: cargo build --locked --no-default-features
- run:
name: Build (all features)
working_directory: ~/project/packages/crypto
command: cargo build --locked --features std
- run:
name: Run tests
working_directory: ~/project/packages/crypto
command: cargo test --locked
command: cargo test --locked --features std
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down Expand Up @@ -1039,7 +1044,7 @@ jobs:
- run:
name: Run crypto benchmarks
working_directory: ~/project/packages/crypto
command: cargo bench -- --color never --save-baseline crypto
command: cargo bench --features std -- --color never --save-baseline crypto
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ and this project adheres to
([#2124])
- cosmwasm-vm: Read the state version from Wasm modules and return them as part
of `AnalyzeReport` ([#2129])
- cosmwasm-vm: Add `bls12_381_aggregate_g1`, `bls12_381_aggregate_g2`,
`bls12_381_pairing_equality`, `bls12_381_hash_to_g1`, and
`bls12_381_hash_to_g2` to enable BLS12-381 curve operations, such as verifying
pairing equalities ([#2106])

[#1983]: https://github.com/CosmWasm/cosmwasm/pull/1983
[#2057]: https://github.com/CosmWasm/cosmwasm/pull/2057
Expand All @@ -46,6 +50,7 @@ and this project adheres to
[#2092]: https://github.com/CosmWasm/cosmwasm/pull/2092
[#2098]: https://github.com/CosmWasm/cosmwasm/pull/2098
[#2099]: https://github.com/CosmWasm/cosmwasm/pull/2099
[#2106]: https://github.com/CosmWasm/cosmwasm/pull/2106
[#2107]: https://github.com/CosmWasm/cosmwasm/pull/2107
[#2120]: https://github.com/CosmWasm/cosmwasm/pull/2120
[#2124]: https://github.com/CosmWasm/cosmwasm/pull/2124
Expand Down
191 changes: 182 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading