From 5216c2d5cb529dc0dea047cc6a109512baedc5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Mon, 25 Sep 2023 11:33:30 +0100 Subject: [PATCH 1/2] renaming scalar multiplication --- .../cryptographic_primitives/01_scalar.mdx | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/standard_library/cryptographic_primitives/01_scalar.mdx b/docs/standard_library/cryptographic_primitives/01_scalar.mdx index 62265cd..ce6b694 100644 --- a/docs/standard_library/cryptographic_primitives/01_scalar.mdx +++ b/docs/standard_library/cryptographic_primitives/01_scalar.mdx @@ -1,33 +1,27 @@ --- title: Scalar multiplication -description: - See how you can perform scalar multiplications over a fixed base in Noir -keywords: - [ - cryptographic primitives, - Noir project, - scalar multiplication, - ] +description: See how you can perform scalar multiplications over a fixed base in Noir +keywords: [cryptographic primitives, Noir project, scalar multiplication] --- -import BlackBoxInfo from './common/\_blackbox.mdx'; +import BlackBoxInfo from './common/_blackbox.mdx'; -## scalar_mul::fixed_base +## scalar_mul::fixed_base_embedded_curve Performs scalar multiplication over the embedded curve whose coordinates are defined by the configured noir field. For the BN254 scalar field, this is BabyJubJub or Grumpkin. ```rust -fn fixed_base(_input : Field) -> [Field; 2] +fn fixed_base_embedded_curve(_input : Field) -> [Field; 2] ``` example ```rust fn main(x : Field) { - let scal = std::scalar_mul::fixed_base(x); + let scal = std::scalar_mul::fixed_base_embedded_curve(x); std::println(scal); } ``` - + From 93bb15a3f2ac06589f9169c58a865e822d34d35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Mon, 25 Sep 2023 11:34:42 +0100 Subject: [PATCH 2/2] renaming scalar multiplication --- docs/modules_packages_crates/dependencies.md | 2 +- docs/standard_library/merkle_trees.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules_packages_crates/dependencies.md b/docs/modules_packages_crates/dependencies.md index 9e64638..75f95aa 100644 --- a/docs/modules_packages_crates/dependencies.md +++ b/docs/modules_packages_crates/dependencies.md @@ -77,7 +77,7 @@ You can also import only the specific parts of dependency that you want to use, ```rust use dep::std::hash::sha256; -use dep::std::scalar_mul::fixed_base; +use dep::std::scalar_mul::fixed_base_embedded_curve; ``` Lastly, as demonstrated in the diff --git a/docs/standard_library/merkle_trees.md b/docs/standard_library/merkle_trees.md index 57d8c4a..9761105 100644 --- a/docs/standard_library/merkle_trees.md +++ b/docs/standard_library/merkle_trees.md @@ -39,7 +39,7 @@ example: */ fn main(index: Field, priv_key: Field, secret: Field, note_hash_path: [Field; 3]) { - let pubkey = std::scalar_mul::fixed_base(priv_key); + let pubkey = std::scalar_mul::fixed_base_embedded_curve(priv_key); let pubkey_x = pubkey[0]; let pubkey_y = pubkey[1]; let note_commitment = std::hash::pedersen([pubkey_x, pubkey_y, secret]);