-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simplify constant MSM calls in SSA (#6547)
- Loading branch information
1 parent
245f50d
commit f291e37
Showing
5 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
test_programs/compile_success_empty/embedded_curve_msm_simplification/Nargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "embedded_curve_msm_simplification" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
12 changes: 12 additions & 0 deletions
12
test_programs/compile_success_empty/embedded_curve_msm_simplification/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
fn main() { | ||
let pub_x = 0x0000000000000000000000000000000000000000000000000000000000000001; | ||
let pub_y = 0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c; | ||
|
||
let g1_y = 17631683881184975370165255887551781615748388533673675138860; | ||
let g1 = std::embedded_curve_ops::EmbeddedCurvePoint { x: 1, y: g1_y, is_infinite: false }; | ||
let scalar = std::embedded_curve_ops::EmbeddedCurveScalar { lo: 1, hi: 0 }; | ||
// Test that multi_scalar_mul correctly derives the public key | ||
let res = std::embedded_curve_ops::multi_scalar_mul([g1], [scalar]); | ||
assert(res.x == pub_x); | ||
assert(res.y == pub_y); | ||
} |