@izi-noir/sdk 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -5
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +6 -5
- package/dist/providers/arkworks.cjs +6 -5
- package/dist/providers/arkworks.js +6 -5
- package/dist/providers/barretenberg.cjs +6 -5
- package/dist/providers/barretenberg.js +6 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -169,18 +169,19 @@ var init_R1csBuilder = __esm({
|
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
171
|
* Register all circuit inputs as witnesses
|
|
172
|
-
*
|
|
172
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
173
|
+
* We must match this order for the witness values to align correctly
|
|
173
174
|
*/
|
|
174
175
|
registerInputs() {
|
|
175
|
-
for (const param of this.parsedCircuit.
|
|
176
|
+
for (const param of this.parsedCircuit.privateParams) {
|
|
176
177
|
const idx = this.nextWitnessIdx++;
|
|
177
178
|
this.witnessMap.set(param.name, idx);
|
|
178
|
-
this.
|
|
179
|
+
this.privateIndices.push(idx);
|
|
179
180
|
}
|
|
180
|
-
for (const param of this.parsedCircuit.
|
|
181
|
+
for (const param of this.parsedCircuit.publicParams) {
|
|
181
182
|
const idx = this.nextWitnessIdx++;
|
|
182
183
|
this.witnessMap.set(param.name, idx);
|
|
183
|
-
this.
|
|
184
|
+
this.publicIndices.push(idx);
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -73,9 +73,9 @@ declare class SolanaFormatter implements IChainFormatter<'solana'> {
|
|
|
73
73
|
*
|
|
74
74
|
* This builder converts parsed JavaScript circuit statements into R1CS constraints.
|
|
75
75
|
*
|
|
76
|
-
* Witness layout (
|
|
76
|
+
* Witness layout (matching Noir's convention):
|
|
77
77
|
* - w_0 = 1 (constant, always)
|
|
78
|
-
* - w_1, w_2, ... = inputs (
|
|
78
|
+
* - w_1, w_2, ... = inputs (private first, then public - matches Noir)
|
|
79
79
|
* - w_k, w_k+1, ... = intermediate variables
|
|
80
80
|
*/
|
|
81
81
|
|
|
@@ -119,7 +119,8 @@ declare class R1csBuilder {
|
|
|
119
119
|
getWitnessIndex(name: string): number | undefined;
|
|
120
120
|
/**
|
|
121
121
|
* Register all circuit inputs as witnesses
|
|
122
|
-
*
|
|
122
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
123
|
+
* We must match this order for the witness values to align correctly
|
|
123
124
|
*/
|
|
124
125
|
private registerInputs;
|
|
125
126
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -73,9 +73,9 @@ declare class SolanaFormatter implements IChainFormatter<'solana'> {
|
|
|
73
73
|
*
|
|
74
74
|
* This builder converts parsed JavaScript circuit statements into R1CS constraints.
|
|
75
75
|
*
|
|
76
|
-
* Witness layout (
|
|
76
|
+
* Witness layout (matching Noir's convention):
|
|
77
77
|
* - w_0 = 1 (constant, always)
|
|
78
|
-
* - w_1, w_2, ... = inputs (
|
|
78
|
+
* - w_1, w_2, ... = inputs (private first, then public - matches Noir)
|
|
79
79
|
* - w_k, w_k+1, ... = intermediate variables
|
|
80
80
|
*/
|
|
81
81
|
|
|
@@ -119,7 +119,8 @@ declare class R1csBuilder {
|
|
|
119
119
|
getWitnessIndex(name: string): number | undefined;
|
|
120
120
|
/**
|
|
121
121
|
* Register all circuit inputs as witnesses
|
|
122
|
-
*
|
|
122
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
123
|
+
* We must match this order for the witness values to align correctly
|
|
123
124
|
*/
|
|
124
125
|
private registerInputs;
|
|
125
126
|
/**
|
package/dist/index.js
CHANGED
|
@@ -147,18 +147,19 @@ var init_R1csBuilder = __esm({
|
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Register all circuit inputs as witnesses
|
|
150
|
-
*
|
|
150
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
151
|
+
* We must match this order for the witness values to align correctly
|
|
151
152
|
*/
|
|
152
153
|
registerInputs() {
|
|
153
|
-
for (const param of this.parsedCircuit.
|
|
154
|
+
for (const param of this.parsedCircuit.privateParams) {
|
|
154
155
|
const idx = this.nextWitnessIdx++;
|
|
155
156
|
this.witnessMap.set(param.name, idx);
|
|
156
|
-
this.
|
|
157
|
+
this.privateIndices.push(idx);
|
|
157
158
|
}
|
|
158
|
-
for (const param of this.parsedCircuit.
|
|
159
|
+
for (const param of this.parsedCircuit.publicParams) {
|
|
159
160
|
const idx = this.nextWitnessIdx++;
|
|
160
161
|
this.witnessMap.set(param.name, idx);
|
|
161
|
-
this.
|
|
162
|
+
this.publicIndices.push(idx);
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
/**
|
|
@@ -72,18 +72,19 @@ var init_R1csBuilder = __esm({
|
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Register all circuit inputs as witnesses
|
|
75
|
-
*
|
|
75
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
76
|
+
* We must match this order for the witness values to align correctly
|
|
76
77
|
*/
|
|
77
78
|
registerInputs() {
|
|
78
|
-
for (const param of this.parsedCircuit.
|
|
79
|
+
for (const param of this.parsedCircuit.privateParams) {
|
|
79
80
|
const idx = this.nextWitnessIdx++;
|
|
80
81
|
this.witnessMap.set(param.name, idx);
|
|
81
|
-
this.
|
|
82
|
+
this.privateIndices.push(idx);
|
|
82
83
|
}
|
|
83
|
-
for (const param of this.parsedCircuit.
|
|
84
|
+
for (const param of this.parsedCircuit.publicParams) {
|
|
84
85
|
const idx = this.nextWitnessIdx++;
|
|
85
86
|
this.witnessMap.set(param.name, idx);
|
|
86
|
-
this.
|
|
87
|
+
this.publicIndices.push(idx);
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
@@ -50,18 +50,19 @@ var init_R1csBuilder = __esm({
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Register all circuit inputs as witnesses
|
|
53
|
-
*
|
|
53
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
54
|
+
* We must match this order for the witness values to align correctly
|
|
54
55
|
*/
|
|
55
56
|
registerInputs() {
|
|
56
|
-
for (const param of this.parsedCircuit.
|
|
57
|
+
for (const param of this.parsedCircuit.privateParams) {
|
|
57
58
|
const idx = this.nextWitnessIdx++;
|
|
58
59
|
this.witnessMap.set(param.name, idx);
|
|
59
|
-
this.
|
|
60
|
+
this.privateIndices.push(idx);
|
|
60
61
|
}
|
|
61
|
-
for (const param of this.parsedCircuit.
|
|
62
|
+
for (const param of this.parsedCircuit.publicParams) {
|
|
62
63
|
const idx = this.nextWitnessIdx++;
|
|
63
64
|
this.witnessMap.set(param.name, idx);
|
|
64
|
-
this.
|
|
65
|
+
this.publicIndices.push(idx);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
@@ -169,18 +169,19 @@ var init_R1csBuilder = __esm({
|
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
171
|
* Register all circuit inputs as witnesses
|
|
172
|
-
*
|
|
172
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
173
|
+
* We must match this order for the witness values to align correctly
|
|
173
174
|
*/
|
|
174
175
|
registerInputs() {
|
|
175
|
-
for (const param of this.parsedCircuit.
|
|
176
|
+
for (const param of this.parsedCircuit.privateParams) {
|
|
176
177
|
const idx = this.nextWitnessIdx++;
|
|
177
178
|
this.witnessMap.set(param.name, idx);
|
|
178
|
-
this.
|
|
179
|
+
this.privateIndices.push(idx);
|
|
179
180
|
}
|
|
180
|
-
for (const param of this.parsedCircuit.
|
|
181
|
+
for (const param of this.parsedCircuit.publicParams) {
|
|
181
182
|
const idx = this.nextWitnessIdx++;
|
|
182
183
|
this.witnessMap.set(param.name, idx);
|
|
183
|
-
this.
|
|
184
|
+
this.publicIndices.push(idx);
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
/**
|
|
@@ -147,18 +147,19 @@ var init_R1csBuilder = __esm({
|
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Register all circuit inputs as witnesses
|
|
150
|
-
*
|
|
150
|
+
* IMPORTANT: Noir orders witnesses as private first, then public
|
|
151
|
+
* We must match this order for the witness values to align correctly
|
|
151
152
|
*/
|
|
152
153
|
registerInputs() {
|
|
153
|
-
for (const param of this.parsedCircuit.
|
|
154
|
+
for (const param of this.parsedCircuit.privateParams) {
|
|
154
155
|
const idx = this.nextWitnessIdx++;
|
|
155
156
|
this.witnessMap.set(param.name, idx);
|
|
156
|
-
this.
|
|
157
|
+
this.privateIndices.push(idx);
|
|
157
158
|
}
|
|
158
|
-
for (const param of this.parsedCircuit.
|
|
159
|
+
for (const param of this.parsedCircuit.publicParams) {
|
|
159
160
|
const idx = this.nextWitnessIdx++;
|
|
160
161
|
this.witnessMap.set(param.name, idx);
|
|
161
|
-
this.
|
|
162
|
+
this.publicIndices.push(idx);
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
/**
|