mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-02 13:53:07 +00:00
Add connect_array convenience method in CircuitBuilder (#1620)
* Add connect_array method * Pacify clippy * Wording
This commit is contained in:
parent
bb8f388091
commit
9fdf1b8ef4
@ -30,3 +30,6 @@ homepage = "https://github.com/0xPolygonZero/plonky2"
|
||||
repository = "https://github.com/0xPolygonZero/plonky2"
|
||||
keywords = ["cryptography", "SNARK", "PLONK", "FRI", "plonky2"]
|
||||
categories = ["cryptography"]
|
||||
|
||||
[workspace.lints.clippy]
|
||||
too_long_first_doc_paragraph = "allow"
|
||||
|
||||
@ -26,3 +26,6 @@ plonky2_util = { version = "0.2.0", path = "../util", default-features = false }
|
||||
# Display math equations properly in documentation
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--html-in-header", ".cargo/katex-header.html"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@ -87,3 +87,6 @@ harness = false
|
||||
# Display math equations properly in documentation
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--html-in-header", ".cargo/katex-header.html"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@ -524,6 +524,13 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
.push(CopyConstraint::new((x, y), self.context_log.open_stack()));
|
||||
}
|
||||
|
||||
/// Enforces that the underlying values of two [`Target`] arrays are equal.
|
||||
pub fn connect_array<const N: usize>(&mut self, x: [Target; N], y: [Target; N]) {
|
||||
for i in 0..N {
|
||||
self.connect(x[i], y[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// Enforces that two [`ExtensionTarget<D>`] underlying values are equal.
|
||||
pub fn connect_extension(&mut self, src: ExtensionTarget<D>, dst: ExtensionTarget<D>) {
|
||||
for i in 0..D {
|
||||
|
||||
@ -36,3 +36,6 @@ env_logger = { version = "0.9.0", default-features = false }
|
||||
# Display math equations properly in documentation
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--html-in-header", ".cargo/katex-header.html"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user