Skip to content

Commit 18e19f6

Browse files
committed
napi: comment out poseidon, and include comments for gatevector
1 parent 7d127e0 commit 18e19f6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

plonk-napi/src/gate_vector.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ macro_rules! impl_gate_support {
148148

149149
#[napi]
150150
pub fn [<caml_pasta_ $field_name:snake _plonk_gate_vector_create>]() -> [<Napi $field_name:camel GateVector>] {
151+
println!("from native rust creating gate vector");
151152
[<Napi $field_name:camel GateVector>](Vec::new())
152153
}
153154

@@ -156,6 +157,7 @@ macro_rules! impl_gate_support {
156157
vector: &mut [<Napi $field_name:camel GateVector>],
157158
gate: [<Napi $field_name:camel Gate>],
158159
) -> Result<()> {
160+
println!("from native rust adding gate to vector");
159161
vector.0.push(gate.into_inner()?);
160162
Ok(())
161163
}
@@ -165,13 +167,15 @@ macro_rules! impl_gate_support {
165167
vector: &[<Napi $field_name:camel GateVector>],
166168
index: i32,
167169
) -> [<Napi $field_name:camel Gate>] {
170+
println!("from native rust getting gate from vector");
168171
[<Napi $field_name:camel Gate>]::from_inner(&vector.0[index as usize])
169172
}
170173

171174
#[napi]
172175
pub fn [<caml_pasta_ $field_name:snake _plonk_gate_vector_len>](
173176
vector: &[<Napi $field_name:camel GateVector>],
174177
) -> i32 {
178+
println!("from native rust getting gate vector length");
175179
vector.0.len() as i32
176180
}
177181

@@ -181,6 +185,7 @@ macro_rules! impl_gate_support {
181185
target: NapiWire,
182186
head: NapiWire,
183187
) {
188+
println!("from native rust wrapping wire in gate vector");
184189
vector.0[target.row as usize].wires[target.col as usize] = KimchiWire::from(head);
185190
}
186191

@@ -189,6 +194,7 @@ macro_rules! impl_gate_support {
189194
public_input_size: i32,
190195
vector: &[<Napi $field_name:camel GateVector>],
191196
) -> Uint8Array {
197+
println!("from native rust computing gate vector digest");
192198
let bytes = Circuit::new(public_input_size as usize, &vector.0)
193199
.digest()
194200
.to_vec();
@@ -200,6 +206,7 @@ macro_rules! impl_gate_support {
200206
public_input_size: i32,
201207
vector: &[<Napi $field_name:camel GateVector>],
202208
) -> Result<String> {
209+
println!("from native rust serializing gate vector to json");
203210
let circuit = Circuit::new(public_input_size as usize, &vector.0);
204211
serde_json::to_string(&circuit).map_err(|err| {
205212
Error::new(

plonk-napi/src/poseidon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use wasm_types::{FlatVector, FlatVectorElem};
99

1010
#[napi]
1111
pub fn caml_pasta_fp_poseidon_block_cipher(state: Uint8Array) -> Result<Uint8Array> {
12-
println!("from native rust");
12+
//println!("from native rust fp poseidon");
1313

1414
let mut state_vec: Vec<Fp> = FlatVector::<WasmPastaFp>::from_bytes(state.to_vec())
1515
.into_iter()
@@ -34,7 +34,7 @@ pub fn caml_pasta_fp_poseidon_block_cipher(state: Uint8Array) -> Result<Uint8Arr
3434

3535
#[napi]
3636
pub fn caml_pasta_fq_poseidon_block_cipher(state: Uint8Array) -> Result<Uint8Array> {
37-
println!("from native rust");
37+
//println!("from native rust fq poseidon");
3838

3939
let mut state_vec: Vec<Fq> = FlatVector::<WasmPastaFq>::from_bytes(state.to_vec())
4040
.into_iter()

0 commit comments

Comments
 (0)