o1js-pack 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/.husky/pre-commit +0 -0
  2. package/README.md +9 -30
  3. package/build/src/index.d.ts +5 -5
  4. package/build/src/index.js +5 -5
  5. package/build/src/lib/PackingPlant.d.ts +132 -140
  6. package/build/src/lib/PackingPlant.js +190 -191
  7. package/build/src/lib/PackingPlant.js.map +1 -1
  8. package/build/src/lib/packed-types/PackedBool.d.ts +85 -90
  9. package/build/src/lib/packed-types/PackedBool.js +49 -48
  10. package/build/src/lib/packed-types/PackedBool.js.map +1 -1
  11. package/build/src/lib/packed-types/PackedBool.test.d.ts +1 -1
  12. package/build/src/lib/packed-types/PackedBool.test.js +75 -75
  13. package/build/src/lib/packed-types/PackedString.d.ts +181 -92
  14. package/build/src/lib/packed-types/PackedString.js +127 -59
  15. package/build/src/lib/packed-types/PackedString.js.map +1 -1
  16. package/build/src/lib/packed-types/PackedString.test.d.ts +1 -1
  17. package/build/src/lib/packed-types/PackedString.test.js +100 -99
  18. package/build/src/lib/packed-types/PackedString.test.js.map +1 -1
  19. package/build/src/lib/packed-types/PackedUInt32.d.ts +85 -90
  20. package/build/src/lib/packed-types/PackedUInt32.js +49 -48
  21. package/build/src/lib/packed-types/PackedUInt32.js.map +1 -1
  22. package/build/src/lib/packed-types/PackedUInt32.test.d.ts +1 -1
  23. package/build/src/lib/packed-types/PackedUInt32.test.js +83 -83
  24. package/package.json +1 -1
  25. package/tests/provable/end_to_end.test.ts +2 -4
  26. package/tests/provable/example_packed_string_circuit.ts +3 -8
  27. package/tests/provable/example_packed_uint_circuit.ts +6 -12
  28. package/build/src/lib/packed-types/PackedCharacter.d.ts +0 -51
  29. package/build/src/lib/packed-types/PackedCharacter.js +0 -34
  30. package/build/src/lib/packed-types/PackedCharacter.js.map +0 -1
  31. package/build/src/lib/packed-types/PackedCharacter.test.d.ts +0 -1
  32. package/build/src/lib/packed-types/PackedCharacter.test.js +0 -31
  33. package/build/src/lib/packed-types/PackedCharacter.test.js.map +0 -1
  34. package/build/src/lib/scratch.d.ts +0 -1
  35. package/build/src/lib/scratch.js +0 -16
  36. package/build/src/lib/scratch.js.map +0 -1
  37. package/build/src/packed-types/PackedBool.d.ts +0 -51
  38. package/build/src/packed-types/PackedBool.js +0 -34
  39. package/build/src/packed-types/PackedBool.js.map +0 -1
  40. package/build/src/packed-types/PackedBool.test.d.ts +0 -1
  41. package/build/src/packed-types/PackedBool.test.js +0 -101
  42. package/build/src/packed-types/PackedBool.test.js.map +0 -1
  43. package/build/src/packed-types/PackedCharacter.d.ts +0 -51
  44. package/build/src/packed-types/PackedCharacter.js +0 -34
  45. package/build/src/packed-types/PackedCharacter.js.map +0 -1
  46. package/build/src/packed-types/PackedCharacter.test.d.ts +0 -1
  47. package/build/src/packed-types/PackedCharacter.test.js +0 -31
  48. package/build/src/packed-types/PackedCharacter.test.js.map +0 -1
  49. package/build/src/packed-types/PackedUInt32.d.ts +0 -51
  50. package/build/src/packed-types/PackedUInt32.js +0 -34
  51. package/build/src/packed-types/PackedUInt32.js.map +0 -1
  52. package/build/src/packed-types/PackedUInt32.test.d.ts +0 -1
  53. package/build/src/packed-types/PackedUInt32.test.js +0 -68
  54. package/build/src/packed-types/PackedUInt32.test.js.map +0 -1
  55. package/build/src/packed-types/PackingPlant.d.ts +0 -54
  56. package/build/src/packed-types/PackingPlant.js +0 -45
  57. package/build/src/packed-types/PackingPlant.js.map +0 -1
  58. package/build/src/packed-types/scratch.d.ts +0 -1
  59. package/build/src/packed-types/scratch.js +0 -5
  60. package/build/src/packed-types/scratch.js.map +0 -1
  61. package/coverage/clover.xml +0 -166
  62. package/coverage/coverage-final.json +0 -5
  63. package/coverage/lcov-report/PackedBool.ts.html +0 -268
  64. package/coverage/lcov-report/PackedUInt32.ts.html +0 -313
  65. package/coverage/lcov-report/base.css +0 -224
  66. package/coverage/lcov-report/block-navigation.js +0 -87
  67. package/coverage/lcov-report/favicon.png +0 -0
  68. package/coverage/lcov-report/index.html +0 -131
  69. package/coverage/lcov-report/lib/PackingPlant.ts.html +0 -478
  70. package/coverage/lcov-report/lib/index.html +0 -116
  71. package/coverage/lcov-report/lib/packed-types/PackedBool.ts.html +0 -238
  72. package/coverage/lcov-report/lib/packed-types/PackedString.ts.html +0 -364
  73. package/coverage/lcov-report/lib/packed-types/PackedUInt32.ts.html +0 -238
  74. package/coverage/lcov-report/lib/packed-types/index.html +0 -146
  75. package/coverage/lcov-report/prettify.css +0 -1
  76. package/coverage/lcov-report/prettify.js +0 -2
  77. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  78. package/coverage/lcov-report/sorter.js +0 -196
  79. package/coverage/lcov.info +0 -282
@@ -1,192 +1,191 @@
1
- import { Field, Struct, provable, Provable, } from 'o1js';
2
- const MAX_BITS_PER_FIELD = 254n;
3
- export function PackingPlant(elementType, l, bitSize) {
4
- if (bitSize * BigInt(l) > MAX_BITS_PER_FIELD) {
5
- throw new Error(`The Packing Plant is only accepting orders that can fit into one Field, try using MultiPackingPlant`);
6
- }
7
- class Packed_ extends Struct({
8
- packed: Field,
9
- }) {
10
- constructor(packed) {
11
- super({ packed });
12
- this.bitSize = bitSize;
13
- }
14
- // Must implement these in type-specific implementation
15
- static extractField(input) {
16
- throw new Error('Must implement extractField');
17
- }
18
- static sizeInBits() {
19
- throw new Error('Must implement sizeInBits');
20
- }
21
- static unpack(f) {
22
- throw new Error('Must implement unpack');
23
- }
24
- // End
25
- /**
26
- *
27
- * @param unpacked Array of the implemented packed type
28
- * @throws if the length of the array is longer than the length of the implementing factory config
29
- */
30
- static checkPack(unpacked) {
31
- if (unpacked.length > l) {
32
- throw new Error(`Input of size ${unpacked.length} is larger than expected size of ${l}`);
33
- }
34
- }
35
- /**
36
- *
37
- * @param unpacked Array of the implemented packed type, must be shorter than the max allowed, which varies by type, will throw if the input is too long
38
- * @returns Field, packed with the information from the unpacked input
39
- */
40
- static pack(unpacked) {
41
- this.checkPack(unpacked);
42
- let f = this.extractField(unpacked[0]);
43
- const n = Math.min(unpacked.length, l);
44
- for (let i = 1; i < n; i++) {
45
- const c = Field((2n ** this.sizeInBits()) ** BigInt(i));
46
- f = f.add(this.extractField(unpacked[i]).mul(c));
47
- }
48
- return f;
49
- }
50
- /**
51
- *
52
- * @param f Field, packed with the information, as returned by #pack
53
- * @returns Array of bigints, which can be decoded by the implementing class into the final type
54
- */
55
- static unpackToBigints(f) {
56
- let unpacked = new Array(l);
57
- unpacked.fill(0n);
58
- let packedN;
59
- if (f) {
60
- packedN = f.toBigInt();
61
- }
62
- else {
63
- throw new Error('No Packed Value Provided');
64
- }
65
- for (let i = 0; i < l; i++) {
66
- unpacked[i] = packedN & ((1n << this.sizeInBits()) - 1n);
67
- packedN >>= this.sizeInBits();
68
- }
69
- return unpacked;
70
- }
71
- assertEquals(other) {
72
- this.packed.assertEquals(other.packed);
73
- }
74
- }
75
- Packed_.type = provable({ packed: Field }, {});
76
- Packed_.l = l;
77
- return Packed_;
78
- }
79
- export function MultiPackingPlant(elementType, l, bitSize) {
80
- if (bitSize * BigInt(l) > 8n * MAX_BITS_PER_FIELD) {
81
- throw new Error(`The Packing Plant is only accepting orders that can fit into eight Fields`);
82
- }
83
- const n = Math.ceil(Number(bitSize * BigInt(l)) / Number(255n));
84
- class Packed_ extends Struct({
85
- packed: Provable.Array(Field, n),
86
- }) {
87
- constructor(packed) {
88
- super({ packed });
89
- this.bitSize = bitSize;
90
- }
91
- // Must implement these in type-specific implementation
92
- static extractField(input) {
93
- throw new Error('Must implement extractField');
94
- }
95
- static sizeInBits() {
96
- throw new Error('Must implement sizeInBits');
97
- }
98
- static elementsPerField() {
99
- throw new Error('Must implement elementsPerField');
100
- }
101
- static unpack(fields) {
102
- throw new Error('Must implement unpack');
103
- }
104
- // End
105
- /**
106
- *
107
- * @param unpacked Array of the implemented packed type
108
- * @throws if the length of the array is longer than the length of the implementing factory config
109
- */
110
- static checkPack(unpacked) {
111
- if (unpacked.length > l) {
112
- throw new Error(`Input of size ${unpacked.length} is larger than expected size of ${l}`);
113
- }
114
- }
115
- /**
116
- *
117
- * @param unpacked Array of the implemented packed type, must be shorter than the max allowed, which varies by type, will throw if the input is too long
118
- * @returns Array of Fields, packed such that each Field has as much information as possible
119
- *
120
- * e.g. 15 Characters pack into 1 Field. 15 or fewer Characters will return an array of 1 Field
121
- * 30 of fewer Characters will return an aray of 2 Fields
122
- */
123
- static pack(unpacked) {
124
- this.checkPack(unpacked);
125
- let fields = [];
126
- let mutableUnpacked = [...unpacked];
127
- while (mutableUnpacked.length > 0) {
128
- let f = this.extractField(mutableUnpacked.shift());
129
- if (!f) {
130
- throw new Error('Unexpected Array Length');
131
- }
132
- // f = f.value is the same as f = 0; f += char.value * c^0;
133
- // If f is initialized as 0, then it is a "constant" field and can't be added to a "variable" field in a proof
134
- const n = Math.min(mutableUnpacked.length + 1, this.elementsPerField());
135
- for (let i = 1; i < n; i++) {
136
- let value = this.extractField(mutableUnpacked.shift());
137
- if (!value) {
138
- throw new Error('Unexpected Array Length');
139
- }
140
- value = value || Field(0);
141
- const c = Field((2n ** this.sizeInBits()) ** BigInt(i));
142
- f = f.add(value.mul(c));
143
- }
144
- fields.push(f);
145
- }
146
- return fields;
147
- }
148
- /**
149
- *
150
- * @param fields Array of Fields, packed such that each Field has as much information as possible, as returned in #pack
151
- * @returns Array of bigints, which can be decoded by the implementing class into the final type
152
- */
153
- static unpackToBigints(fields) {
154
- let uints_ = new Array(l);
155
- uints_.fill(0n);
156
- let packedNs = new Array(this.n);
157
- packedNs.fill(0n);
158
- const packedArg = new Array(this.n);
159
- packedArg.fill(Field(0), 0, this.n);
160
- for (let i = 0; i < this.n; i++) {
161
- if (fields[i]) {
162
- packedArg[i] = fields[i];
163
- }
164
- }
165
- if (packedArg.length !== this.n) {
166
- throw new Error(`Packed value must be exactly ${this.n} in length`);
167
- }
168
- for (let i = 0; i < this.n; i++) {
169
- packedNs[i] = packedArg[i].toConstant().toBigInt();
170
- }
171
- for (let i = 0; i < packedNs.length; i++) {
172
- let packedN = packedNs[i];
173
- for (let j = 0; j < this.elementsPerField(); j++) {
174
- const k = i * this.elementsPerField() + j;
175
- uints_[k] = packedN & ((1n << this.sizeInBits()) - 1n);
176
- packedN >>= this.sizeInBits();
177
- }
178
- }
179
- return uints_;
180
- }
181
- assertEquals(other) {
182
- for (let x = 0; x < n; x++) {
183
- this.packed[x].assertEquals(other.packed[x]);
184
- }
185
- }
186
- }
187
- Packed_.type = provable({ packed: Provable.Array(Field, n) }, {});
188
- Packed_.l = l;
189
- Packed_.n = n;
190
- return Packed_;
191
- }
1
+ import { Field, Struct, provable, Provable, } from 'o1js';
2
+ const MAX_BITS_PER_FIELD = 254n;
3
+ export function PackingPlant(elementType, l, bitSize) {
4
+ if (bitSize * BigInt(l) > MAX_BITS_PER_FIELD) {
5
+ throw new Error(`The Packing Plant is only accepting orders that can fit into one Field, try using MultiPackingPlant`);
6
+ }
7
+ class Packed_ extends Struct({
8
+ packed: Field,
9
+ }) {
10
+ constructor(packed) {
11
+ super({ packed });
12
+ }
13
+ // Must implement these in type-specific implementation
14
+ static extractField(input) {
15
+ throw new Error('Must implement extractField');
16
+ }
17
+ static sizeInBits() {
18
+ throw new Error('Must implement sizeInBits');
19
+ }
20
+ static unpack(f) {
21
+ throw new Error('Must implement unpack');
22
+ }
23
+ // End
24
+ /**
25
+ *
26
+ * @param unpacked Array of the implemented packed type
27
+ * @throws if the length of the array is longer than the length of the implementing factory config
28
+ */
29
+ static checkPack(unpacked) {
30
+ if (unpacked.length > l) {
31
+ throw new Error(`Input of size ${unpacked.length} is larger than expected size of ${l}`);
32
+ }
33
+ }
34
+ /**
35
+ *
36
+ * @param unpacked Array of the implemented packed type, must be shorter than the max allowed, which varies by type, will throw if the input is too long
37
+ * @returns Field, packed with the information from the unpacked input
38
+ */
39
+ static pack(unpacked) {
40
+ this.checkPack(unpacked);
41
+ let f = this.extractField(unpacked[0]);
42
+ const n = Math.min(unpacked.length, l);
43
+ for (let i = 1; i < n; i++) {
44
+ const c = Field((2n ** this.sizeInBits()) ** BigInt(i));
45
+ f = f.add(this.extractField(unpacked[i]).mul(c));
46
+ }
47
+ return f;
48
+ }
49
+ /**
50
+ *
51
+ * @param f Field, packed with the information, as returned by #pack
52
+ * @returns Array of bigints, which can be decoded by the implementing class into the final type
53
+ */
54
+ static unpackToBigints(f) {
55
+ let unpacked = new Array(l);
56
+ unpacked.fill(0n);
57
+ let packedN;
58
+ if (f) {
59
+ packedN = f.toBigInt();
60
+ }
61
+ else {
62
+ throw new Error('No Packed Value Provided');
63
+ }
64
+ for (let i = 0; i < l; i++) {
65
+ unpacked[i] = packedN & ((1n << this.sizeInBits()) - 1n);
66
+ packedN >>= this.sizeInBits();
67
+ }
68
+ return unpacked;
69
+ }
70
+ assertEquals(other) {
71
+ this.packed.assertEquals(other.packed);
72
+ }
73
+ }
74
+ Packed_.type = provable({ packed: Field }, {});
75
+ Packed_.l = l;
76
+ Packed_.bitSize = bitSize;
77
+ return Packed_;
78
+ }
79
+ export function MultiPackingPlant(elementType, l, bitSize) {
80
+ if (bitSize * BigInt(l) > 8n * MAX_BITS_PER_FIELD) {
81
+ throw new Error(`The Packing Plant is only accepting orders that can fit into eight Fields`);
82
+ }
83
+ const n = Math.ceil(Number(bitSize * BigInt(l)) / Number(255n));
84
+ class Packed_ extends Struct({
85
+ packed: Provable.Array(Field, n),
86
+ }) {
87
+ constructor(packed) {
88
+ super({ packed });
89
+ }
90
+ // Must implement these in type-specific implementation
91
+ static extractField(input) {
92
+ throw new Error('Must implement extractField');
93
+ }
94
+ static sizeInBits() {
95
+ throw new Error('Must implement sizeInBits');
96
+ }
97
+ static elementsPerField() {
98
+ throw new Error('Must implement elementsPerField');
99
+ }
100
+ static unpack(fields) {
101
+ throw new Error('Must implement unpack');
102
+ }
103
+ // End
104
+ /**
105
+ *
106
+ * @param unpacked Array of the implemented packed type
107
+ * @throws if the length of the array is longer than the length of the implementing factory config
108
+ */
109
+ static checkPack(unpacked) {
110
+ if (unpacked.length > this.l) {
111
+ throw new Error(`Input of size ${unpacked.length} is larger than expected size of ${l}`);
112
+ }
113
+ }
114
+ /**
115
+ *
116
+ * @param unpacked Array of the implemented packed type, must be shorter than the max allowed, which varies by type, will throw if the input is too long
117
+ * @returns Array of Fields, packed such that each Field has as much information as possible
118
+ *
119
+ * e.g. 15 Characters pack into 1 Field. 15 or fewer Characters will return an array of 1 Field
120
+ * 30 of fewer Characters will return an aray of 2 Fields
121
+ */
122
+ static pack(unpacked) {
123
+ this.checkPack(unpacked);
124
+ const q = this.elementsPerField();
125
+ let fields = [];
126
+ let mutableUnpacked = [...unpacked];
127
+ for (let i = 0; i < this.n; i++) {
128
+ let f = this.extractField(mutableUnpacked[i * q]);
129
+ if (!f) {
130
+ throw new Error('Unexpected Array Length');
131
+ }
132
+ for (let j = 1; j < q; j++) {
133
+ const idx = i * q + j;
134
+ let value = this.extractField(mutableUnpacked[idx]);
135
+ if (!value) {
136
+ throw new Error('Unexpected Array Length');
137
+ }
138
+ value = value || Field(0);
139
+ const c = Field((2n ** this.sizeInBits()) ** BigInt(j));
140
+ f = f.add(value.mul(c));
141
+ }
142
+ fields.push(f);
143
+ }
144
+ return fields;
145
+ }
146
+ /**
147
+ *
148
+ * @param fields Array of Fields, packed such that each Field has as much information as possible, as returned in #pack
149
+ * @returns Array of bigints, which can be decoded by the implementing class into the final type
150
+ */
151
+ static unpackToBigints(fields) {
152
+ let uints_ = new Array(this.l); // array length is number of elements per field * number of fields
153
+ uints_.fill(0n);
154
+ let packedNs = new Array(this.n);
155
+ packedNs.fill(0n);
156
+ const packedArg = new Array(this.n);
157
+ packedArg.fill(Field(0), 0, this.n);
158
+ for (let i = 0; i < this.n; i++) {
159
+ if (fields[i]) {
160
+ packedArg[i] = fields[i];
161
+ }
162
+ }
163
+ if (packedArg.length !== this.n) {
164
+ throw new Error(`Packed value must be exactly ${this.n} in length`);
165
+ }
166
+ for (let i = 0; i < this.n; i++) {
167
+ packedNs[i] = packedArg[i].toConstant().toBigInt();
168
+ }
169
+ for (let i = 0; i < packedNs.length; i++) {
170
+ let packedN = packedNs[i];
171
+ for (let j = 0; j < this.elementsPerField(); j++) {
172
+ const k = i * this.elementsPerField() + j;
173
+ uints_[k] = packedN & ((1n << this.sizeInBits()) - 1n);
174
+ packedN >>= this.sizeInBits();
175
+ }
176
+ }
177
+ return uints_;
178
+ }
179
+ assertEquals(other) {
180
+ for (let x = 0; x < n; x++) {
181
+ this.packed[x].assertEquals(other.packed[x]);
182
+ }
183
+ }
184
+ }
185
+ Packed_.type = provable({ packed: Provable.Array(Field, n) }, {});
186
+ Packed_.l = l;
187
+ Packed_.n = n;
188
+ Packed_.bitSize = bitSize;
189
+ return Packed_;
190
+ }
192
191
  //# sourceMappingURL=PackingPlant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PackingPlant.js","sourceRoot":"","sources":["../../../src/lib/PackingPlant.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EAEN,QAAQ,EAER,QAAQ,GACT,MAAM,MAAM,CAAC;AAEd,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,UAAU,YAAY,CAC1B,WAAc,EACd,CAAS,EACT,OAAe;IAEf,IAAI,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,kBAAkB,EAAE;QAC5C,MAAM,IAAI,KAAK,CACb,qGAAqG,CACtG,CAAC;KACH;IACD,MAAe,OAAQ,SAAQ,MAAM,CAAC;QACpC,MAAM,EAAE,KAAK;KACd,CAAC;QAKA,YAAY,MAAa;YACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;YAHpB,YAAO,GAAW,OAAO,CAAC;QAI1B,CAAC;QAED,uDAAuD;QACvD,MAAM,CAAC,YAAY,CAAC,KAAQ;YAC1B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,CAAC,UAAU;YACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QA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Bool } from 'o1js';
2
- export declare function PackedBoolFactory(l?: number): {
3
- new (packed: import("o1js/dist/node/lib/field.js").Field): {
4
- toBooleans(): Array<boolean>;
5
- bitSize: bigint;
6
- assertEquals(other: {
7
- bitSize: bigint;
8
- assertEquals(other: any): void;
9
- packed: import("o1js/dist/node/lib/field.js").Field;
10
- }): void;
11
- packed: import("o1js/dist/node/lib/field.js").Field;
12
- };
13
- extractField(input: Bool): Field;
14
- sizeInBits(): bigint;
15
- /**
16
- *
17
- * @param f Field, packed with the information, as returned by #pack
18
- * @returns Array of Bool
19
- */
20
- unpack(f: Field): Bool[];
21
- /**
22
- *
23
- * @param bools Array of Bools to be packed
24
- * @returns Instance of the implementing class
25
- */
26
- fromBools(bools: Array<Bool>): {
27
- toBooleans(): Array<boolean>;
28
- bitSize: bigint;
29
- assertEquals(other: {
30
- bitSize: bigint;
31
- assertEquals(other: any): void;
32
- packed: import("o1js/dist/node/lib/field.js").Field;
33
- }): void;
34
- packed: import("o1js/dist/node/lib/field.js").Field;
35
- };
36
- /**
37
- *
38
- * @param booleans Array of booleans to be packed
39
- * @returns Instance of the implementing class
40
- */
41
- fromBooleans(booleans: Array<boolean>): {
42
- toBooleans(): Array<boolean>;
43
- bitSize: bigint;
44
- assertEquals(other: {
45
- bitSize: bigint;
46
- assertEquals(other: any): void;
47
- packed: import("o1js/dist/node/lib/field.js").Field;
48
- }): void;
49
- packed: import("o1js/dist/node/lib/field.js").Field;
50
- };
51
- type: import("o1js/dist/node/bindings/lib/provable-snarky.js").ProvableExtended<{
52
- packed: import("o1js/dist/node/lib/field.js").Field;
53
- }, {
54
- packed: string;
55
- }>;
56
- l: number;
57
- checkPack(unpacked: import("o1js/dist/node/lib/bool.js").Bool[]): void;
58
- pack(unpacked: import("o1js/dist/node/lib/bool.js").Bool[]): import("o1js/dist/node/lib/field.js").Field;
59
- unpackToBigints(f: import("o1js/dist/node/lib/field.js").Field): bigint[];
60
- _isStruct: true;
61
- toFields: (value: {
62
- packed: import("o1js/dist/node/lib/field.js").Field;
63
- }) => import("o1js/dist/node/lib/field.js").Field[];
64
- toAuxiliary: (value?: {
65
- packed: import("o1js/dist/node/lib/field.js").Field;
66
- } | undefined) => any[];
67
- fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
68
- packed: import("o1js/dist/node/lib/field.js").Field;
69
- };
70
- sizeInFields(): number;
71
- check: (value: {
72
- packed: import("o1js/dist/node/lib/field.js").Field;
73
- }) => void;
74
- toInput: (x: {
75
- packed: import("o1js/dist/node/lib/field.js").Field;
76
- }) => {
77
- fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
78
- packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
79
- };
80
- toJSON: (x: {
81
- packed: import("o1js/dist/node/lib/field.js").Field;
82
- }) => {
83
- packed: string;
84
- };
85
- fromJSON: (x: {
86
- packed: string;
87
- }) => {
88
- packed: import("o1js/dist/node/lib/field.js").Field;
89
- };
90
- };
1
+ import { Field, Bool } from 'o1js';
2
+ export declare function PackedBoolFactory(l?: number): {
3
+ new (packed: import("o1js/dist/node/lib/field.js").Field): {
4
+ toBooleans(): Array<boolean>;
5
+ assertEquals(other: {
6
+ assertEquals(other: any): void;
7
+ packed: import("o1js/dist/node/lib/field.js").Field;
8
+ }): void;
9
+ packed: import("o1js/dist/node/lib/field.js").Field;
10
+ };
11
+ extractField(input: Bool): Field;
12
+ sizeInBits(): bigint;
13
+ /**
14
+ *
15
+ * @param f Field, packed with the information, as returned by #pack
16
+ * @returns Array of Bool
17
+ */
18
+ unpack(f: Field): Bool[];
19
+ /**
20
+ *
21
+ * @param bools Array of Bools to be packed
22
+ * @returns Instance of the implementing class
23
+ */
24
+ fromBools(bools: Array<Bool>): {
25
+ toBooleans(): Array<boolean>;
26
+ assertEquals(other: {
27
+ assertEquals(other: any): void;
28
+ packed: import("o1js/dist/node/lib/field.js").Field;
29
+ }): void;
30
+ packed: import("o1js/dist/node/lib/field.js").Field;
31
+ };
32
+ /**
33
+ *
34
+ * @param booleans Array of booleans to be packed
35
+ * @returns Instance of the implementing class
36
+ */
37
+ fromBooleans(booleans: Array<boolean>): {
38
+ toBooleans(): Array<boolean>;
39
+ assertEquals(other: {
40
+ assertEquals(other: any): void;
41
+ packed: import("o1js/dist/node/lib/field.js").Field;
42
+ }): void;
43
+ packed: import("o1js/dist/node/lib/field.js").Field;
44
+ };
45
+ type: import("o1js/dist/node/bindings/lib/provable-snarky.js").ProvableExtended<{
46
+ packed: import("o1js/dist/node/lib/field.js").Field;
47
+ }, {
48
+ packed: string;
49
+ }>;
50
+ l: number;
51
+ bitSize: bigint;
52
+ checkPack(unpacked: import("o1js/dist/node/lib/bool.js").Bool[]): void;
53
+ pack(unpacked: import("o1js/dist/node/lib/bool.js").Bool[]): import("o1js/dist/node/lib/field.js").Field;
54
+ unpackToBigints(f: import("o1js/dist/node/lib/field.js").Field): bigint[];
55
+ _isStruct: true;
56
+ toFields: (value: {
57
+ packed: import("o1js/dist/node/lib/field.js").Field;
58
+ }) => import("o1js/dist/node/lib/field.js").Field[];
59
+ toAuxiliary: (value?: {
60
+ packed: import("o1js/dist/node/lib/field.js").Field;
61
+ } | undefined) => any[];
62
+ fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
63
+ packed: import("o1js/dist/node/lib/field.js").Field;
64
+ };
65
+ sizeInFields(): number;
66
+ check: (value: {
67
+ packed: import("o1js/dist/node/lib/field.js").Field;
68
+ }) => void;
69
+ toInput: (x: {
70
+ packed: import("o1js/dist/node/lib/field.js").Field;
71
+ }) => {
72
+ fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
73
+ packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
74
+ };
75
+ toJSON: (x: {
76
+ packed: import("o1js/dist/node/lib/field.js").Field;
77
+ }) => {
78
+ packed: string;
79
+ };
80
+ fromJSON: (x: {
81
+ packed: string;
82
+ }) => {
83
+ packed: import("o1js/dist/node/lib/field.js").Field;
84
+ };
85
+ };