Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use mod.nr files in stdlib #5379

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ curve you want to use, which would be specified using any one of the methods
`std::ec::{tecurve,montcurve,swcurve}::{affine,curvegroup}::new` which take the coefficients in the
defining equation together with a generator point as parameters. You can find more detail in the
comments in
[`noir_stdlib/src/ec.nr`](https://github.com/noir-lang/noir/blob/master/noir_stdlib/src/ec.nr), but
[`noir_stdlib/src/ec/mod.nr`](https://github.com/noir-lang/noir/blob/master/noir_stdlib/src/ec/mod.nr), but
the gist of it is that the elliptic curves of interest are usually expressed in one of the standard
forms implemented here (Twisted Edwards, Montgomery and Short Weierstraß), and in addition to that,
you could choose to use `affine` coordinates (Cartesian coordinates - the usual (x,y) - possibly
Expand Down Expand Up @@ -67,7 +67,7 @@ does indeed lie on `c` by calling `c.contains(p1)`.
the curve configurations, the SWU map-to-curve method may be called as `c.swu_map(z,n)`, where
`z: Field` depends on `Field` and `c` and must be chosen by the user (the conditions it needs to
satisfy are specified in the comments
[here](https://github.com/noir-lang/noir/blob/master/noir_stdlib/src/ec.nr)).
[here](https://github.com/noir-lang/noir/blob/master/noir_stdlib/src/ec/mod.nr)).

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
Given an array of bytes, returns the resulting sha256 hash.
Specify a message_size to hash only the first `message_size` bytes of the input.

#include_code sha256 noir_stdlib/src/hash.nr rust
#include_code sha256 noir_stdlib/src/hash/mod.nr rust

example:
#include_code sha256_var test_programs/execution_success/sha256/src/main.nr rust
Expand All @@ -34,7 +34,7 @@ fn main() {

Given an array of bytes, returns an array with the Blake2 hash

#include_code blake2s noir_stdlib/src/hash.nr rust
#include_code blake2s noir_stdlib/src/hash/mod.nr rust

example:

Expand All @@ -51,7 +51,7 @@ fn main() {

Given an array of bytes, returns an array with the Blake3 hash

#include_code blake3 noir_stdlib/src/hash.nr rust
#include_code blake3 noir_stdlib/src/hash/mod.nr rust

example:

Expand All @@ -68,7 +68,7 @@ fn main() {

Given an array of Fields, returns the Pedersen hash.

#include_code pedersen_hash noir_stdlib/src/hash.nr rust
#include_code pedersen_hash noir_stdlib/src/hash/mod.nr rust

example:

Expand All @@ -80,7 +80,7 @@ example:

Given an array of Fields, returns the Pedersen commitment.

#include_code pedersen_commitment noir_stdlib/src/hash.nr rust
#include_code pedersen_commitment noir_stdlib/src/hash/mod.nr rust

example:

Expand All @@ -94,7 +94,7 @@ Given an array of bytes (`u8`), returns the resulting keccak hash as an array of
32 bytes (`[u8; 32]`). Specify a message_size to hash only the first
`message_size` bytes of the input.

#include_code keccak256 noir_stdlib/src/hash.nr rust
#include_code keccak256 noir_stdlib/src/hash/mod.nr rust

example:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading