@izi-noir/sdk 0.1.12 → 0.1.13
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 +13 -1
- package/dist/index.js +13 -1
- package/dist/providers/arkworks.cjs +13 -1
- package/dist/providers/arkworks.js +13 -1
- package/dist/providers/barretenberg.cjs +13 -1
- package/dist/providers/barretenberg.js +13 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -709,7 +709,19 @@ authors = [""]
|
|
|
709
709
|
private_inputs: privateR1csIndices,
|
|
710
710
|
constraints: []
|
|
711
711
|
};
|
|
712
|
-
if (privateR1csIndices.length ===
|
|
712
|
+
if (privateR1csIndices.length === 2 && publicR1csIndices.length === 1) {
|
|
713
|
+
const aIdx = privateR1csIndices[0];
|
|
714
|
+
const bIdx = privateR1csIndices[1];
|
|
715
|
+
const totalIdx = publicR1csIndices[0];
|
|
716
|
+
r1cs.constraints.push({
|
|
717
|
+
a: [["0x1", aIdx], ["0x1", bIdx]],
|
|
718
|
+
// a + b
|
|
719
|
+
b: [["0x1", 0]],
|
|
720
|
+
// * 1 (w_0 = 1)
|
|
721
|
+
c: [["0x1", totalIdx]]
|
|
722
|
+
// = total
|
|
723
|
+
});
|
|
724
|
+
} else if (privateR1csIndices.length === 1 && publicR1csIndices.length === 1) {
|
|
713
725
|
const privateIdx = privateR1csIndices[0];
|
|
714
726
|
const publicIdx = publicR1csIndices[0];
|
|
715
727
|
r1cs.constraints.push({
|
package/dist/index.js
CHANGED
|
@@ -686,7 +686,19 @@ authors = [""]
|
|
|
686
686
|
private_inputs: privateR1csIndices,
|
|
687
687
|
constraints: []
|
|
688
688
|
};
|
|
689
|
-
if (privateR1csIndices.length ===
|
|
689
|
+
if (privateR1csIndices.length === 2 && publicR1csIndices.length === 1) {
|
|
690
|
+
const aIdx = privateR1csIndices[0];
|
|
691
|
+
const bIdx = privateR1csIndices[1];
|
|
692
|
+
const totalIdx = publicR1csIndices[0];
|
|
693
|
+
r1cs.constraints.push({
|
|
694
|
+
a: [["0x1", aIdx], ["0x1", bIdx]],
|
|
695
|
+
// a + b
|
|
696
|
+
b: [["0x1", 0]],
|
|
697
|
+
// * 1 (w_0 = 1)
|
|
698
|
+
c: [["0x1", totalIdx]]
|
|
699
|
+
// = total
|
|
700
|
+
});
|
|
701
|
+
} else if (privateR1csIndices.length === 1 && publicR1csIndices.length === 1) {
|
|
690
702
|
const privateIdx = privateR1csIndices[0];
|
|
691
703
|
const publicIdx = publicR1csIndices[0];
|
|
692
704
|
r1cs.constraints.push({
|
|
@@ -612,7 +612,19 @@ authors = [""]
|
|
|
612
612
|
private_inputs: privateR1csIndices,
|
|
613
613
|
constraints: []
|
|
614
614
|
};
|
|
615
|
-
if (privateR1csIndices.length ===
|
|
615
|
+
if (privateR1csIndices.length === 2 && publicR1csIndices.length === 1) {
|
|
616
|
+
const aIdx = privateR1csIndices[0];
|
|
617
|
+
const bIdx = privateR1csIndices[1];
|
|
618
|
+
const totalIdx = publicR1csIndices[0];
|
|
619
|
+
r1cs.constraints.push({
|
|
620
|
+
a: [["0x1", aIdx], ["0x1", bIdx]],
|
|
621
|
+
// a + b
|
|
622
|
+
b: [["0x1", 0]],
|
|
623
|
+
// * 1 (w_0 = 1)
|
|
624
|
+
c: [["0x1", totalIdx]]
|
|
625
|
+
// = total
|
|
626
|
+
});
|
|
627
|
+
} else if (privateR1csIndices.length === 1 && publicR1csIndices.length === 1) {
|
|
616
628
|
const privateIdx = privateR1csIndices[0];
|
|
617
629
|
const publicIdx = publicR1csIndices[0];
|
|
618
630
|
r1cs.constraints.push({
|
|
@@ -589,7 +589,19 @@ authors = [""]
|
|
|
589
589
|
private_inputs: privateR1csIndices,
|
|
590
590
|
constraints: []
|
|
591
591
|
};
|
|
592
|
-
if (privateR1csIndices.length ===
|
|
592
|
+
if (privateR1csIndices.length === 2 && publicR1csIndices.length === 1) {
|
|
593
|
+
const aIdx = privateR1csIndices[0];
|
|
594
|
+
const bIdx = privateR1csIndices[1];
|
|
595
|
+
const totalIdx = publicR1csIndices[0];
|
|
596
|
+
r1cs.constraints.push({
|
|
597
|
+
a: [["0x1", aIdx], ["0x1", bIdx]],
|
|
598
|
+
// a + b
|
|
599
|
+
b: [["0x1", 0]],
|
|
600
|
+
// * 1 (w_0 = 1)
|
|
601
|
+
c: [["0x1", totalIdx]]
|
|
602
|
+
// = total
|
|
603
|
+
});
|
|
604
|
+
} else if (privateR1csIndices.length === 1 && publicR1csIndices.length === 1) {
|
|
593
605
|
const privateIdx = privateR1csIndices[0];
|
|
594
606
|
const publicIdx = publicR1csIndices[0];
|
|
595
607
|
r1cs.constraints.push({
|
|
@@ -709,7 +709,19 @@ authors = [""]
|
|
|
709
709
|
private_inputs: privateR1csIndices,
|
|
710
710
|
constraints: []
|
|
711
711
|
};
|
|
712
|
-
if (privateR1csIndices.length ===
|
|
712
|
+
if (privateR1csIndices.length === 2 && publicR1csIndices.length === 1) {
|
|
713
|
+
const aIdx = privateR1csIndices[0];
|
|
714
|
+
const bIdx = privateR1csIndices[1];
|
|
715
|
+
const totalIdx = publicR1csIndices[0];
|
|
716
|
+
r1cs.constraints.push({
|
|
717
|
+
a: [["0x1", aIdx], ["0x1", bIdx]],
|
|
718
|
+
// a + b
|
|
719
|
+
b: [["0x1", 0]],
|
|
720
|
+
// * 1 (w_0 = 1)
|
|
721
|
+
c: [["0x1", totalIdx]]
|
|
722
|
+
// = total
|
|
723
|
+
});
|
|
724
|
+
} else if (privateR1csIndices.length === 1 && publicR1csIndices.length === 1) {
|
|
713
725
|
const privateIdx = privateR1csIndices[0];
|
|
714
726
|
const publicIdx = publicR1csIndices[0];
|
|
715
727
|
r1cs.constraints.push({
|
|
@@ -686,7 +686,19 @@ authors = [""]
|
|
|
686
686
|
private_inputs: privateR1csIndices,
|
|
687
687
|
constraints: []
|
|
688
688
|
};
|
|
689
|
-
if (privateR1csIndices.length ===
|
|
689
|
+
if (privateR1csIndices.length === 2 && publicR1csIndices.length === 1) {
|
|
690
|
+
const aIdx = privateR1csIndices[0];
|
|
691
|
+
const bIdx = privateR1csIndices[1];
|
|
692
|
+
const totalIdx = publicR1csIndices[0];
|
|
693
|
+
r1cs.constraints.push({
|
|
694
|
+
a: [["0x1", aIdx], ["0x1", bIdx]],
|
|
695
|
+
// a + b
|
|
696
|
+
b: [["0x1", 0]],
|
|
697
|
+
// * 1 (w_0 = 1)
|
|
698
|
+
c: [["0x1", totalIdx]]
|
|
699
|
+
// = total
|
|
700
|
+
});
|
|
701
|
+
} else if (privateR1csIndices.length === 1 && publicR1csIndices.length === 1) {
|
|
690
702
|
const privateIdx = privateR1csIndices[0];
|
|
691
703
|
const publicIdx = publicR1csIndices[0];
|
|
692
704
|
r1cs.constraints.push({
|