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

fix(docs): Rename recursion.md to recursion.mdx #6195

Merged
merged 5 commits into from
Oct 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
2 changes: 1 addition & 1 deletion docs/docs/explainers/explainer-recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ He might find it more efficient to generate a proof for that setup phase separat

## What params do I need

As you can see in the [recursion reference](noir/standard_library/recursion.md), a simple recursive proof requires:
As you can see in the [recursion reference](noir/standard_library/recursion.mdx), a simple recursive proof requires:

- The proof to verify
- The Verification Key of the circuit that generated the proof
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/how_to/how-to-recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This guide shows you how to use recursive proofs in your NoirJS app. For the sak

- You already have a NoirJS app. If you don't, please visit the [NoirJS tutorial](../tutorials/noirjs_app.md) and the [reference](../reference/NoirJS/noir_js/index.md).
- You are familiar with what are recursive proofs and you have read the [recursion explainer](../explainers/explainer-recursion.md)
- You already built a recursive circuit following [the reference](../noir/standard_library/recursion.md), and understand how it works.
- You already built a recursive circuit following [the reference](../noir/standard_library/recursion.mdx), and understand how it works.

It is also assumed that you're not using `noir_wasm` for compilation, and instead you've used [`nargo compile`](../reference/nargo_commands.md) to generate the `json` you're now importing into your project. However, the guide should work just the same if you're using `noir_wasm`.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/noir/standard_library/black_box_fns.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Here is a list of the current black box functions:
- XOR
- RANGE
- [Keccak256](./cryptographic_primitives/hashes.mdx#keccak256)
- [Recursive proof verification](./recursion.md)
- [Recursive proof verification](./recursion.mdx)

Most black box functions are included as part of the Noir standard library, however `AND`, `XOR` and `RANGE` are used as part of the Noir language syntax. For instance, using the bitwise operator `&` will invoke the `AND` black box function.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
sidebar_position: 0
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

## aes128

Expand All @@ -25,4 +25,4 @@ fn main() {
```


<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords: [cryptographic primitives, Noir project, ecdsa, secp256k1, secp256r1,
sidebar_position: 3
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

Noir supports ECDSA signatures verification over the secp256k1 and secp256r1 curves.

Expand All @@ -25,15 +25,15 @@ fn main(hashed_message : [u8;32], pub_key_x : [u8;32], pub_key_y : [u8;32], sign
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns" />

## ecdsa_secp256k1::verify_signature_slice

Verifier for ECDSA Secp256k1 signatures where the message is a slice.

#include_code ecdsa_secp256k1_slice noir_stdlib/src/ecdsa_secp256k1.nr rust

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## ecdsa_secp256r1::verify_signature

Expand All @@ -51,12 +51,12 @@ fn main(hashed_message : [u8;32], pub_key_x : [u8;32], pub_key_y : [u8;32], sign
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## ecdsa_secp256r1::verify_signature

Verifier for ECDSA Secp256r1 signatures where the message is a slice.

#include_code ecdsa_secp256r1_slice noir_stdlib/src/ecdsa_secp256r1.nr rust

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords: [cryptographic primitives, Noir project, eddsa, signatures]
sidebar_position: 5
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

## eddsa::eddsa_poseidon_verify

Expand All @@ -23,7 +23,7 @@ use std::hash::poseidon2::Poseidon2Hasher;
eddsa_verify::<Poseidon2Hasher>(pub_key_a.x, pub_key_a.y, s_a, r8_a.x, r8_a.y, msg);
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## eddsa::eddsa_to_pub

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords: [cryptographic primitives, Noir project, scalar multiplication]
sidebar_position: 1
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

The following functions perform operations over the embedded curve whose coordinates are defined by the configured noir field.
For the BN254 scalar field, this is BabyJubJub or Grumpkin.
Expand Down Expand Up @@ -74,4 +74,4 @@ fn main() {
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords:
sidebar_position: 0
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

## sha256

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


<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## blake2s

Expand All @@ -45,7 +45,7 @@ fn main() {
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## blake3

Expand All @@ -62,7 +62,7 @@ fn main() {
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## pedersen_hash

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

#include_code pedersen-hash test_programs/execution_success/pedersen_hash/src/main.nr rust

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns" />

## pedersen_commitment

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

#include_code pedersen-commitment test_programs/execution_success/pedersen_commitment/src/main.nr rust

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## keccak256

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

#include_code keccak256 test_programs/execution_success/keccak256/src/main.nr rust

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## poseidon

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords: [cryptographic primitives, Noir project, schnorr, signatures]
sidebar_position: 2
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

## schnorr::verify_signature

Expand Down Expand Up @@ -34,7 +34,7 @@ const signature = Array.from(
...
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## schnorr::verify_signature_slice

Expand All @@ -43,4 +43,4 @@ where the message is a slice.

#include_code schnorr_verify_slice noir_stdlib/src/schnorr.nr rust

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Learn about how to write recursive proofs in Noir.
keywords: [recursion, recursive proofs, verification_key, verify_proof]
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

Noir supports recursively verifying proofs, meaning you verify the proof of a Noir program in another Noir program. This enables creating proofs of arbitrary size by doing step-wise verification of smaller components of a large proof.

Expand Down Expand Up @@ -35,7 +35,7 @@ By incorporating this attribute directly in the circuit's definition, tooling li
pub fn verify_proof(verification_key: [Field], proof: [Field], public_inputs: [Field], key_hash: Field) {}
```

<BlackBoxInfo />
<BlackBoxInfo to="black_box_fns"/>

## Example usage

Expand Down
12 changes: 12 additions & 0 deletions docs/src/components/Notes/_blackbox.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Link from '@docusaurus/Link';

export default function BlackBoxInfo({ to }) {
return (
<div>
<p>
This is a black box function. Read <Link to={to}>this section</Link> to learn more about black box functions in
Noir.
</p>
</div>
);
}
5 changes: 0 additions & 5 deletions docs/src/components/Notes/_blackbox.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ He might find it more efficient to generate a proof for that setup phase separat

## What params do I need

As you can see in the [recursion reference](noir/standard_library/recursion.md), a simple recursive proof requires:
As you can see in the [recursion reference](noir/standard_library/recursion.mdx), a simple recursive proof requires:

- The proof to verify
- The Verification Key of the circuit that generated the proof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This guide shows you how to use recursive proofs in your NoirJS app. For the sak

- You already have a NoirJS app. If you don't, please visit the [NoirJS tutorial](../tutorials/noirjs_app.md) and the [reference](../reference/NoirJS/noir_js/index.md).
- You are familiar with what are recursive proofs and you have read the [recursion explainer](../explainers/explainer-recursion.md)
- You already built a recursive circuit following [the reference](../noir/standard_library/recursion.md), and understand how it works.
- You already built a recursive circuit following [the reference](../noir/standard_library/recursion.mdx), and understand how it works.

It is also assumed that you're not using `noir_wasm` for compilation, and instead you've used [`nargo compile`](../reference/nargo_commands.md) to generate the `json` you're now importing into your project. However, the guide should work just the same if you're using `noir_wasm`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Here is a list of the current black box functions:
- XOR
- RANGE
- [Keccak256](./cryptographic_primitives/hashes.mdx#keccak256)
- [Recursive proof verification](./recursion.md)
- [Recursive proof verification](./recursion.mdx)

Most black box functions are included as part of the Noir standard library, however `AND`, `XOR` and `RANGE` are used as part of the Noir language syntax. For instance, using the bitwise operator `&` will invoke the `AND` black box function.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
sidebar_position: 0
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

## aes128

Expand All @@ -29,4 +29,4 @@ fn main() {
```


<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords: [cryptographic primitives, Noir project, ecdsa, secp256k1, secp256r1,
sidebar_position: 3
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

Noir supports ECDSA signatures verification over the secp256k1 and secp256r1 curves.

Expand Down Expand Up @@ -34,7 +34,7 @@ fn main(hashed_message : [u8;32], pub_key_x : [u8;32], pub_key_y : [u8;32], sign
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## ecdsa_secp256k1::verify_signature_slice

Expand All @@ -51,7 +51,7 @@ pub fn verify_signature_slice(
> <sup><sub><a href="https://github.com/noir-lang/noir/blob/master/noir_stdlib/src/ecdsa_secp256k1.nr#L13-L20" target="_blank" rel="noopener noreferrer">Source code: noir_stdlib/src/ecdsa_secp256k1.nr#L13-L20</a></sub></sup>


<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## ecdsa_secp256r1::verify_signature

Expand All @@ -78,7 +78,7 @@ fn main(hashed_message : [u8;32], pub_key_x : [u8;32], pub_key_y : [u8;32], sign
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>

## ecdsa_secp256r1::verify_signature

Expand All @@ -95,4 +95,4 @@ pub fn verify_signature_slice(
> <sup><sub><a href="https://github.com/noir-lang/noir/blob/master/noir_stdlib/src/ecdsa_secp256r1.nr#L13-L20" target="_blank" rel="noopener noreferrer">Source code: noir_stdlib/src/ecdsa_secp256r1.nr#L13-L20</a></sub></sup>


<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords: [cryptographic primitives, Noir project, eddsa, signatures]
sidebar_position: 5
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

## eddsa::eddsa_poseidon_verify

Expand All @@ -23,7 +23,7 @@ use std::hash::poseidon2::Poseidon2Hasher;
eddsa_verify::<Poseidon2Hasher>(pub_key_a.x, pub_key_a.y, s_a, r8_a.x, r8_a.y, msg);
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns" />

## eddsa::eddsa_to_pub

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords: [cryptographic primitives, Noir project, scalar multiplication]
sidebar_position: 1
---

import BlackBoxInfo from '@site/src/components/Notes/_blackbox.mdx';
import BlackBoxInfo from '@site/src/components/Notes/_blackbox';

The following functions perform operations over the embedded curve whose coordinates are defined by the configured noir field.
For the BN254 scalar field, this is BabyJubJub or Grumpkin.
Expand Down Expand Up @@ -95,4 +95,4 @@ fn main() {
}
```

<BlackBoxInfo />
<BlackBoxInfo to="../black_box_fns"/>
Loading
Loading