Commit ecad5ad
Add bn254 support and expose poseidon/poseidon2 host functions (#1667)
### What
* Add bn254 support (#1615, #1628)
- A new module `crypto/bn254.rs` with Bn254 point and field types, and
expose related host operations.
- Implement `Neg` trait for `G1Affine` (#1630)
- Update bn254 typenames and add mapping (#1645), also updated bls12-381
type names for consistency
* Add raw Poseidon, Poseidon2 support in `CryptoHazmat`, gated by
"hazmat-crypto" feature
### Why
Expose new crypto functions for protocol 25
### Known limitations
Only the raw host function exposure for Poseidon/Poseidon2 has been
added in this PR. The more elaborate setup for sponge, parameters, hash
function wrappers will be done in a separate repo
[here](https://github.com/stellar/rs-soroban-poseidon)
---------
Co-authored-by: Jay Geng <jay@stellar.org>
Co-authored-by: Siddharth Suresh <siddharth@stellar.org>
Co-authored-by: Leigh <351529+leighmcculloch@users.noreply.github.com>
Co-authored-by: Matteo Lisotto <matteo.lisotto@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Nando Vieira <me@fnando.com>1 parent a60b7e8 commit ecad5ad
File tree
183 files changed
+3514
-377
lines changed- soroban-ledger-snapshot/src
- soroban-sdk-macros/src
- soroban-sdk
- src
- crypto
- tests
- testutils
- test_snapshots/tests
- address
- auth
- auth_10_one
- auth_15_one_repeat
- auth_17_no_consume_requirement
- auth_20_deep_one_address
- auth_30_deep_one_address_repeat
- auth_35_deep_one_address_repeat_grouped
- auth_40_multi_one_address
- contract_add_i32
- contract_assert
- contract_custom_account_impl
- contract_docs/fn_
- contract_duration
- contract_event
- contract_fn
- contract_invoke_arg_count
- contract_invoke
- contract_overlapping_type_fn_names
- contract_snapshot
- contract_store
- contract_timepoint
- contract_udt_enum_error
- contract_udt_enum
- contract_udt_option
- contract_udt_struct_tuple
- contract_udt_struct
- cost_estimate
- crypto_bls12_381
- env
- max_ttl
- muxed_address
- prng
- storage_testutils
- token_client
- soroban-token-sdk/test_snapshots/tests/events
- stellar-asset-spec/test_snapshots/tests/events
- tests-expanded
- tests
- account/test_snapshots/test
- add_i128/test_snapshots/test
- add_u128/test_snapshots/test
- add_u64/test_snapshots/test
- alloc/test_snapshots/test/wasm
- associated_type_contracttrait/test_snapshots
- test_with_wasm
- test
- associated_type/test_snapshots/test
- auth/test_snapshots
- test_a
- test_b
- bls
- src
- test_snapshots/test
- bn254
- src
- test_snapshots/test
- constructor/test_snapshots
- contracttrait_impl_full/test_snapshots/test
- contracttrait_impl_partial/test_snapshots/test
- contracttrait_trait/test_snapshots/test
- empty2/test_snapshots/test
- empty/test_snapshots/test
- errors/test_snapshots/test
- events_ref/test_snapshots/test
- events/test_snapshots/test
- fuzz/fuzz
- generics/test_snapshots/test
- invoke_contract/test_snapshots/test
- logging/test_snapshots/test
- macros/test_snapshots/test
- modular/test_snapshots/test
- multiimpl/test_snapshots/test
- mutability/test_snapshots/test
- tuples/test_snapshots/test
- udt/test_snapshots/test
- workspace_contract/test_snapshots/test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
183 files changed
+3514
-377
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 156 | + | |
167 | 157 | | |
168 | 158 | | |
169 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | | - | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
60 | | - | |
| 65 | + | |
61 | 66 | | |
62 | | - | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
87 | 118 | | |
88 | 119 | | |
89 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
182 | 186 | | |
183 | 187 | | |
184 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
185 | 195 | | |
186 | 196 | | |
187 | 197 | | |
| |||
254 | 264 | | |
255 | 265 | | |
256 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
257 | 331 | | |
0 commit comments