-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: incorrect secondary file in LSP errors (noir-lang/noir#7347)
chore: Basic test for MSM in Noir to catch performance improvements and regressions (noir-lang/noir#7341) fix(cli): Only lock the packages selected in the workspace (noir-lang/noir#7345) chore: remove some unused types and functions in the AST (noir-lang/noir#7339) chore: remove foreign calls array from Brillig VM constructor (noir-lang/noir#7337) chore(ci): Add Vecs and vecs to cspell (noir-lang/noir#7342) chore: redo typo PR by osrm (noir-lang/noir#7238) chore: Release Noir(1.0.0-beta.2) (noir-lang/noir#6914) fix: lock git dependencies folder when resolving workspace (noir-lang/noir#7327) fix: perform SSA constraints check on final SSA (noir-lang/noir#7334) chore: remove misleading output from `nargo check` (noir-lang/noir#7329) chore: fix warnings (noir-lang/noir#7330) chore: normalize path displayed by `nargo new` (noir-lang/noir#7328) chore: split acirgen into multiple modules (noir-lang/noir#7310) chore: remove unnecessary constants (noir-lang/noir#7326)
- Loading branch information
Showing
17 changed files
with
327 additions
and
239 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
df0d72970a9d64d7bf6132b55142e26bb3720d73 | ||
5d782f020f6aec6aaa8a445c3a6a5fb9b275e3c6 |
6 changes: 6 additions & 0 deletions
6
noir/noir-repo/test_programs/execution_success/multi_scalar_mul/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 = "multi_scalar_mul" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
26 changes: 26 additions & 0 deletions
26
noir/noir-repo/test_programs/execution_success/multi_scalar_mul/Prover.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,26 @@ | ||
scalars = ["0", "0", "0", "0", "0"] | ||
|
||
[[points]] | ||
is_infinite = "0" | ||
x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" | ||
|
||
[[points]] | ||
is_infinite = "0" | ||
x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" | ||
|
||
[[points]] | ||
is_infinite = "0" | ||
x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" | ||
|
||
[[points]] | ||
is_infinite = "0" | ||
x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" | ||
|
||
[[points]] | ||
is_infinite = "0" | ||
x = "0x0000000000000000000000000000000000000000000000000000000000000001" | ||
y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c" |
45 changes: 45 additions & 0 deletions
45
noir/noir-repo/test_programs/execution_success/multi_scalar_mul/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,45 @@ | ||
// This test provides a basic implementation of a MSM in Noir, that allows us to check | ||
// performance improvements and regressions. | ||
use std::embedded_curve_ops::embedded_curve_add_unsafe; | ||
use std::embedded_curve_ops::EmbeddedCurvePoint; | ||
|
||
// `main` must be marked unconstrained as the function uses `break` internally | ||
unconstrained fn main( | ||
points: [EmbeddedCurvePoint; 5], | ||
scalars: [Field; 5], | ||
) -> pub EmbeddedCurvePoint { | ||
// EmbeddedCurveScalar are two 128-bit numbers | ||
let mut acc = EmbeddedCurvePoint::point_at_infinity(); | ||
for i in 0..1 { | ||
// These should probably be EmbeddedCurveScalars | ||
// let full_scalar: Field = scalars[i].hi * 2.pow_32(128) + scalars[i].lo; | ||
let full_scalar = scalars[i]; | ||
let full_scalar_bits: [u1; 254] = full_scalar.to_be_bits(); | ||
let mut index_of_msb = 0; | ||
// Iterates in BE | ||
for j in 0..254 { | ||
if full_scalar_bits[j] == 1 { | ||
index_of_msb = j; | ||
break; | ||
} | ||
} | ||
|
||
let mut temp = points[i]; | ||
let mut res = EmbeddedCurvePoint::point_at_infinity(); | ||
// When iterative backwards we want to go to bits.len() - 2 | ||
for j in 0..(254 - index_of_msb) { | ||
let k = 253 - j; | ||
|
||
// Add | ||
if full_scalar_bits[k] == 1 { | ||
res = embedded_curve_add_unsafe(res, temp); | ||
} | ||
// Double | ||
temp = embedded_curve_add_unsafe(temp, temp); | ||
} | ||
|
||
acc = embedded_curve_add_unsafe(acc, res); | ||
} | ||
acc | ||
} | ||
|
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
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
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
Oops, something went wrong.