Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
iAmMichaelConnor committed Oct 11, 2024
1 parent 1843b35 commit 82ae959
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
9 changes: 0 additions & 9 deletions info.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
nargo compile --force && bb gates -b ./target/noir_bigcurve.json

# This is the command I've been using, to then view a flamegraph at localhost:3000:
# You'll need to replace all the paths for nargo, bb, the json file, for whatever they are on your machine.
# And you'll need a recent version of nargo; possibly the one inside aztec-packages.

# ~/git/noir/target/debug/nargo compile && ~/.bb/bb gates_mega_honk -b ./target/noir_bigcurve.json > txt.txt && ~/git/noir/target/debug/noir-profiler gates-flamegraph --artifact-path ./target/noir_bigcurve.json --backend-path ~/.bb/bb --output ./flamegraph --backend-gates-command "gates_mega_honk" && python3 -m http.server --directory "./flamegraph" 3000


bb gates -b target/use.json -h
13 changes: 10 additions & 3 deletions src/curves/bls12_381.nr
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ impl CurveParamsTrait<BigNum<4, BLS12_381_Fq_Params>> for BLS12_381_Curve_Params
pub type BLS12_381_Point = BigCurve<Fq, BLS12_381_Curve_Params>;
pub type BLS12_381_Point_J = CurveJ<Fq, BLS12_381_Curve_Params>;


// TESTING:

unconstrained fn __evaluate_mul(P: BLS12_381_Point_J, scalar: ScalarField<64>, Q: BLS12_381_Point_J, K: BLS12_381_Point_J) -> bool {
unconstrained fn __evaluate_mul(
P: BLS12_381_Point_J,
scalar: ScalarField<64>,
Q: BLS12_381_Point_J,
K: BLS12_381_Point_J
) -> bool {
let s = (P.__mul(scalar));
assert(s.0.eq(K.__neg()));
Q.eq(s.0)
Expand All @@ -96,7 +100,10 @@ unconstrained fn __get_msm_transcript(
s.1
}

unconstrained fn __get_mul_transcript(P: BLS12_381_Point_J, scalar: ScalarField<64>) -> [AffineTranscript<Fq>; 326] {
unconstrained fn __get_mul_transcript(
P: BLS12_381_Point_J,
scalar: ScalarField<64>
) -> [AffineTranscript<Fq>; 326] {
let res = P.__mul(scalar);
let transcript = res.1;
transcript.as_array()
Expand Down
6 changes: 1 addition & 5 deletions src/curves/bn254.nr
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ impl CurveParamsTrait<BigNum<3, BN254_Fq_Params>> for BN254_Curve_Params {
pub type BN254_Point = BigCurve<Fq, BN254_Curve_Params>;
pub type BN254_Point_J = CurveJ<Fq, BN254_Curve_Params>;


// TESTING:


unconstrained fn __get_msm_transcript(
P: BN254_Point_J,
Q: BN254_Point_J,
Expand All @@ -74,9 +72,7 @@ unconstrained fn __get_mul_transcript(
) -> [AffineTranscript<Fq>; 326] {
let res = P.__mul(scalar);
let transcript = res.1;
// println(f"let transcript: AffineTranscript<N, Params> = {transcript}");
// let ff = transcript.len();
// println(f"transcript len = {ff}");

transcript.as_array()
}

Expand Down
Empty file removed txt.txt
Empty file.

0 comments on commit 82ae959

Please sign in to comment.