Skip to content

Commit 7267a4c

Browse files
Avaneesh-axiomjonathanpwang
authored andcommitted
Update _init! macro calls in various places
1 parent a027803 commit 7267a4c

File tree

10 files changed

+14
-16
lines changed

10 files changed

+14
-16
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "115792089237316195423570985008687907853269984665640564039457584007908834671663", "115792089237316195423570985008687907852837564279074904382605163141518161494337" }
3-
openvm_ecc_guest::sw_macros::sw_init! { Secp256k1Point }
3+
openvm_ecc_guest::sw_macros::sw_init! { "Secp256k1Point" }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "1000000000000000003", "115792089237316195423570985008687907853269984665640564039457584007908834671663", "115792089237316195423570985008687907852837564279074904382605163141518161494337", "115792089210356248762697446949407573530086143415290314195533631308867097853951", "115792089210356248762697446949407573529996955224135760342422259061068512044369", "21888242871839275222246405745257275088696311157297823662689037894645226208583", "21888242871839275222246405745257275088548364400416034343698204186575808495617", "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787", "52435875175126190479447740508185965837690552500527637822603658699938581184513", "2305843009213693951", "7" }
3-
openvm_algebra_guest::complex_macros::complex_init! { Bn254Fp2 { mod_idx = 5 }, Bls12_381Fp2 { mod_idx = 7 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { Secp256k1Point, P256Point, Bn254G1Affine, Bls12_381G1Affine }
3+
openvm_algebra_guest::complex_macros::complex_init! { "Bn254Fp2" { mod_idx = 5 }, "Bls12_381Fp2" { mod_idx = 7 } }
4+
openvm_ecc_guest::sw_macros::sw_init! { "Secp256k1Point", "P256Point", "Bn254G1Affine", "Bls12_381G1Affine" }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "21888242871839275222246405745257275088696311157297823662689037894645226208583", "21888242871839275222246405745257275088548364400416034343698204186575808495617" }
3-
openvm_algebra_guest::complex_macros::complex_init! { Bn254Fp2 { mod_idx = 0 } }
4-
openvm_ecc_guest::sw_macros::sw_init! { Bn254G1Affine }
3+
openvm_algebra_guest::complex_macros::complex_init! { "Bn254Fp2" { mod_idx = 0 } }
4+
openvm_ecc_guest::sw_macros::sw_init! { "Bn254G1Affine" }

book/src/custom-extensions/ecc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This creates `Bls12_381G1Affine` and `P256Affine` structs which implement the `G
4949
openvm::init!();
5050
/* This expands to
5151
sw_init! {
52-
Bls12_381G1Affine, P256Affine,
52+
"Bls12_381G1Affine", "P256Affine",
5353
}
5454
*/
5555
```

examples/algebra/openvm_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "998244353", "1000000007" }
3-
openvm_algebra_guest::complex_macros::complex_init! { Complex1 { mod_idx = 0 }, Complex2 { mod_idx = 1 } }
3+
openvm_algebra_guest::complex_macros::complex_init! { "Complex1" { mod_idx = 0 }, "Complex2" { mod_idx = 1 } }

examples/ecc/openvm_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "115792089237316195423570985008687907853269984665640564039457584007908834671663", "115792089237316195423570985008687907852837564279074904382605163141518161494337" }
3-
openvm_ecc_guest::sw_macros::sw_init! { Secp256k1Point }
3+
openvm_ecc_guest::sw_macros::sw_init! { "Secp256k1Point" }

examples/ecc/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ openvm_algebra_guest::moduli_macros::moduli_init! {
1313
"0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141"
1414
}
1515
16-
openvm_ecc_guest::sw_macros::sw_init! {
17-
Secp256k1Point,
18-
}
16+
openvm_ecc_guest::sw_macros::sw_init! { "Secp256k1Point" }
1917
*/
2018
// ANCHOR_END: init
2119

examples/pairing/openvm_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is automatically generated by cargo openvm. Do not rename or edit.
22
openvm_algebra_guest::moduli_macros::moduli_init! { "4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787" }
3-
openvm_algebra_guest::complex_macros::complex_init! { Bls12_381Fp2 { mod_idx = 0 } }
3+
openvm_algebra_guest::complex_macros::complex_init! { "Bls12_381Fp2" { mod_idx = 0 } }

examples/pairing/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ openvm_algebra_moduli_macros::moduli_init! {
1919
}
2020
2121
openvm_algebra_complex_macros::complex_init! {
22-
Bls12_381Fp2 { mod_idx = 0 },
22+
"Bls12_381Fp2" { mod_idx = 0 },
2323
}
2424
*/
2525
// ANCHOR_END: init

extensions/ecc/sw-macros/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ openvm_algebra_guest::moduli_macros::moduli_init! {
2828
}
2929
3030
openvm_ecc_guest::sw_macros::sw_init! {
31-
Secp256k1Point,
31+
"Secp256k1Point",
3232
}
3333
*/
3434

@@ -45,7 +45,7 @@ The crate provides two macros: `sw_declare!` and `sw_init!`. The signatures are:
4545

4646
- `sw_declare!` receives comma-separated list of moduli classes descriptions. Each description looks like `SwStruct { mod_type = ModulusName, a = a_expr, b = b_expr }`. Here `ModulusName` is the name of a struct that implements `trait IntMod` -- in particular, the ones created by `moduli_declare!` do -- and has `NUM_LIMBS` divisible by 4. Parameters `a` and `b` correspond to the coefficients of the equation defining the curve. They **must be compile-time constants**. The parameter `a` may be omitted, in which case it defaults to `0` (or, more specifically, to `<ModulusName as IntMod>::ZERO`). The parameter `b` is required.
4747

48-
- `sw_init!` receives comma-separated list of struct names. The struct name must exactly match the name in `sw_declare!` -- type defs are not allowed (see point 5 below).
48+
- `sw_init!` receives comma-separated list of struct names as string literals. Each struct name must exactly match the name in `sw_declare!` -- type defs are not allowed (see point 5 below).
4949

5050
What happens under the hood:
5151

@@ -107,7 +107,7 @@ sw_declare! {
107107
pub type Sw = Secp256k1Point;
108108

109109
sw_init! {
110-
Sw,
110+
"Sw",
111111
}
112112
```
113113

0 commit comments

Comments
 (0)