-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathalt_bn128.py
867 lines (654 loc) · 34.8 KB
/
alt_bn128.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise RuntimeError("Python 2.7 or later required")
# Import the low-level C/C++ module
if __package__ or "." in __name__:
from . import _alt_bn128
else:
import _alt_bn128
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
def _swig_setattr_nondynamic_instance_variable(set):
def set_instance_attr(self, name, value):
if name == "thisown":
self.this.own(value)
elif name == "this":
set(self, name, value)
elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
set(self, name, value)
else:
raise AttributeError("You cannot add instance attributes to %s" % self)
return set_instance_attr
def _swig_setattr_nondynamic_class_variable(set):
def set_class_attr(cls, name, value):
if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
set(cls, name, value)
else:
raise AttributeError("You cannot add class attributes to %s" % cls)
return set_class_attr
def _swig_add_metaclass(metaclass):
"""Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
def wrapper(cls):
return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
return wrapper
class _SwigNonDynamicMeta(type):
"""Meta class to enforce nondynamic attributes (no new attributes) for a class"""
__setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
class Ft(object):
r"""Proxy of C++ Ft class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
r"""__init__(Ft self) -> Ft"""
_alt_bn128.Ft_swiginit(self, _alt_bn128.new_Ft())
__swig_destroy__ = _alt_bn128.delete_Ft
# Register Ft in _alt_bn128:
_alt_bn128.Ft_swigregister(Ft)
cvar = _alt_bn128.cvar
class Fqt(object):
r"""Proxy of C++ Fqt class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
r"""__init__(Fqt self) -> Fqt"""
_alt_bn128.Fqt_swiginit(self, _alt_bn128.new_Fqt())
__swig_destroy__ = _alt_bn128.delete_Fqt
# Register Fqt in _alt_bn128:
_alt_bn128.Fqt_swigregister(Fqt)
class Fq2t(object):
r"""Proxy of C++ Fq2t class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def getc0(self):
r"""getc0(Fq2t self) -> Fqt"""
return _alt_bn128.Fq2t_getc0(self)
def getc1(self):
r"""getc1(Fq2t self) -> Fqt"""
return _alt_bn128.Fq2t_getc1(self)
def __init__(self):
r"""__init__(Fq2t self) -> Fq2t"""
_alt_bn128.Fq2t_swiginit(self, _alt_bn128.new_Fq2t())
__swig_destroy__ = _alt_bn128.delete_Fq2t
# Register Fq2t in _alt_bn128:
_alt_bn128.Fq2t_swigregister(Fq2t)
def fieldinverse(val):
r"""fieldinverse(Ft val) -> Ft"""
return _alt_bn128.fieldinverse(val)
def get_modulus():
r"""get_modulus() -> libff::bigint< Ft::num_limbs >"""
return _alt_bn128.get_modulus()
class G1(object):
r"""
Proxy of C++ libff::G1< libff::alt_bn128_pp > class.
Proxy of C++ libff::G1< libff::alt_bn128_pp > class.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def to_affine_coordinates(self):
r"""to_affine_coordinates(G1 self)"""
return _alt_bn128.G1_to_affine_coordinates(self)
def write(self, *args):
r"""write(G1 self, std::ostream & str=std::cout)"""
return _alt_bn128.G1_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> G1"""
return _alt_bn128.G1_read(*args)
def str(self):
r"""str(G1 self) -> std::string"""
return _alt_bn128.G1_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> G1"""
return _alt_bn128.G1_fromstr(str)
def getx(self):
r"""getx(G1 self) -> Fqt"""
return _alt_bn128.G1_getx(self)
def gety(self):
r"""gety(G1 self) -> Fqt"""
return _alt_bn128.G1_gety(self)
def getz(self):
r"""getz(G1 self) -> Fqt"""
return _alt_bn128.G1_getz(self)
def __init__(self):
r"""__init__(G1 self) -> G1"""
_alt_bn128.G1_swiginit(self, _alt_bn128.new_G1())
__swig_destroy__ = _alt_bn128.delete_G1
# Register G1 in _alt_bn128:
_alt_bn128.G1_swigregister(G1)
def G1_read(*args):
r"""G1_read(std::istream & str=std::cin) -> G1"""
return _alt_bn128.G1_read(*args)
def G1_fromstr(str):
r"""G1_fromstr(std::string const & str) -> G1"""
return _alt_bn128.G1_fromstr(str)
class G2(object):
r"""
Proxy of C++ libff::G2< libff::alt_bn128_pp > class.
Proxy of C++ libff::G2< libff::alt_bn128_pp > class.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
X = property(_alt_bn128.G2_X_get, _alt_bn128.G2_X_set, doc=r"""X : Fq2t""")
Y = property(_alt_bn128.G2_Y_get, _alt_bn128.G2_Y_set, doc=r"""Y : Fq2t""")
Z = property(_alt_bn128.G2_Z_get, _alt_bn128.G2_Z_set, doc=r"""Z : Fq2t""")
def write(self, *args):
r"""write(G2 self, std::ostream & str=std::cout)"""
return _alt_bn128.G2_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> G2"""
return _alt_bn128.G2_read(*args)
def str(self):
r"""str(G2 self) -> std::string"""
return _alt_bn128.G2_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> G2"""
return _alt_bn128.G2_fromstr(str)
def __init__(self):
r"""__init__(G2 self) -> G2"""
_alt_bn128.G2_swiginit(self, _alt_bn128.new_G2())
__swig_destroy__ = _alt_bn128.delete_G2
# Register G2 in _alt_bn128:
_alt_bn128.G2_swigregister(G2)
def G2_read(*args):
r"""G2_read(std::istream & str=std::cin) -> G2"""
return _alt_bn128.G2_read(*args)
def G2_fromstr(str):
r"""G2_fromstr(std::string const & str) -> G2"""
return _alt_bn128.G2_fromstr(str)
class KnowledgeCommitmentG1G1(object):
r"""Proxy of C++ libsnark::knowledge_commitment< libff::G1< libff::alt_bn128_pp >,libff::G1< libff::alt_bn128_pp > > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
g = property(_alt_bn128.KnowledgeCommitmentG1G1_g_get, _alt_bn128.KnowledgeCommitmentG1G1_g_set, doc=r"""g : libff::G1<(libff::alt_bn128_pp)>""")
h = property(_alt_bn128.KnowledgeCommitmentG1G1_h_get, _alt_bn128.KnowledgeCommitmentG1G1_h_set, doc=r"""h : libff::G1<(libff::alt_bn128_pp)>""")
def __init__(self):
r"""__init__(KnowledgeCommitmentG1G1 self) -> KnowledgeCommitmentG1G1"""
_alt_bn128.KnowledgeCommitmentG1G1_swiginit(self, _alt_bn128.new_KnowledgeCommitmentG1G1())
__swig_destroy__ = _alt_bn128.delete_KnowledgeCommitmentG1G1
# Register KnowledgeCommitmentG1G1 in _alt_bn128:
_alt_bn128.KnowledgeCommitmentG1G1_swigregister(KnowledgeCommitmentG1G1)
class KnowledgeCommitmentG2G1(object):
r"""Proxy of C++ libsnark::knowledge_commitment< libff::G2< libff::alt_bn128_pp >,libff::G1< libff::alt_bn128_pp > > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
g = property(_alt_bn128.KnowledgeCommitmentG2G1_g_get, _alt_bn128.KnowledgeCommitmentG2G1_g_set, doc=r"""g : libff::G2<(libff::alt_bn128_pp)>""")
h = property(_alt_bn128.KnowledgeCommitmentG2G1_h_get, _alt_bn128.KnowledgeCommitmentG2G1_h_set, doc=r"""h : libff::G1<(libff::alt_bn128_pp)>""")
def __init__(self):
r"""__init__(KnowledgeCommitmentG2G1 self) -> KnowledgeCommitmentG2G1"""
_alt_bn128.KnowledgeCommitmentG2G1_swiginit(self, _alt_bn128.new_KnowledgeCommitmentG2G1())
__swig_destroy__ = _alt_bn128.delete_KnowledgeCommitmentG2G1
# Register KnowledgeCommitmentG2G1 in _alt_bn128:
_alt_bn128.KnowledgeCommitmentG2G1_swigregister(KnowledgeCommitmentG2G1)
class Variable(object):
r"""Proxy of C++ libsnark::variable< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
index = property(_alt_bn128.Variable_index_get, _alt_bn128.Variable_index_set, doc=r"""index : var_index_t""")
def __init__(self):
r"""__init__(Variable self) -> Variable"""
_alt_bn128.Variable_swiginit(self, _alt_bn128.new_Variable())
__swig_destroy__ = _alt_bn128.delete_Variable
# Register Variable in _alt_bn128:
_alt_bn128.Variable_swigregister(Variable)
class PbVariable(Variable):
r"""Proxy of C++ libsnark::pb_variable< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
r"""__init__(PbVariable self) -> PbVariable"""
_alt_bn128.PbVariable_swiginit(self, _alt_bn128.new_PbVariable())
def allocate(self, *args):
r"""allocate(PbVariable self, Protoboard pb, std::string const & annotation="")"""
return _alt_bn128.PbVariable_allocate(self, *args)
__swig_destroy__ = _alt_bn128.delete_PbVariable
# Register PbVariable in _alt_bn128:
_alt_bn128.PbVariable_swigregister(PbVariable)
class LinearCombination(object):
r"""Proxy of C++ libsnark::linear_combination< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
__init__(LinearCombination self) -> LinearCombination
__init__(LinearCombination self, Ft field_coeff) -> LinearCombination
__init__(LinearCombination self, PbVariable var) -> LinearCombination
"""
_alt_bn128.LinearCombination_swiginit(self, _alt_bn128.new_LinearCombination(*args))
def __mul__(self, field_coeff):
r"""__mul__(LinearCombination self, Ft field_coeff) -> LinearCombination"""
return _alt_bn128.LinearCombination___mul__(self, field_coeff)
def __add__(self, other):
r"""__add__(LinearCombination self, LinearCombination other) -> LinearCombination"""
return _alt_bn128.LinearCombination___add__(self, other)
def __sub__(self, other):
r"""__sub__(LinearCombination self, LinearCombination other) -> LinearCombination"""
return _alt_bn128.LinearCombination___sub__(self, other)
def __neg__(self):
r"""__neg__(LinearCombination self) -> LinearCombination"""
return _alt_bn128.LinearCombination___neg__(self)
def write(self, *args):
r"""write(LinearCombination self, std::ostream & str=std::cout)"""
return _alt_bn128.LinearCombination_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> LinearCombination"""
return _alt_bn128.LinearCombination_read(*args)
def str(self):
r"""str(LinearCombination self) -> std::string"""
return _alt_bn128.LinearCombination_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> LinearCombination"""
return _alt_bn128.LinearCombination_fromstr(str)
__swig_destroy__ = _alt_bn128.delete_LinearCombination
# Register LinearCombination in _alt_bn128:
_alt_bn128.LinearCombination_swigregister(LinearCombination)
def LinearCombination_read(*args):
r"""LinearCombination_read(std::istream & str=std::cin) -> LinearCombination"""
return _alt_bn128.LinearCombination_read(*args)
def LinearCombination_fromstr(str):
r"""LinearCombination_fromstr(std::string const & str) -> LinearCombination"""
return _alt_bn128.LinearCombination_fromstr(str)
class R1csConstraint(object):
r"""Proxy of C++ libsnark::r1cs_constraint< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
a = property(_alt_bn128.R1csConstraint_a_get, _alt_bn128.R1csConstraint_a_set, doc=r"""a : libsnark::linear_combination<(Ft)>""")
b = property(_alt_bn128.R1csConstraint_b_get, _alt_bn128.R1csConstraint_b_set, doc=r"""b : libsnark::linear_combination<(Ft)>""")
c = property(_alt_bn128.R1csConstraint_c_get, _alt_bn128.R1csConstraint_c_set, doc=r"""c : libsnark::linear_combination<(Ft)>""")
def __init__(self, a, b, c):
r"""__init__(R1csConstraint self, LinearCombination a, LinearCombination b, LinearCombination c) -> R1csConstraint"""
_alt_bn128.R1csConstraint_swiginit(self, _alt_bn128.new_R1csConstraint(a, b, c))
def write(self, *args):
r"""write(R1csConstraint self, std::ostream & str=std::cout)"""
return _alt_bn128.R1csConstraint_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> R1csConstraint"""
return _alt_bn128.R1csConstraint_read(*args)
def str(self):
r"""str(R1csConstraint self) -> std::string"""
return _alt_bn128.R1csConstraint_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> R1csConstraint"""
return _alt_bn128.R1csConstraint_fromstr(str)
__swig_destroy__ = _alt_bn128.delete_R1csConstraint
# Register R1csConstraint in _alt_bn128:
_alt_bn128.R1csConstraint_swigregister(R1csConstraint)
def R1csConstraint_read(*args):
r"""R1csConstraint_read(std::istream & str=std::cin) -> R1csConstraint"""
return _alt_bn128.R1csConstraint_read(*args)
def R1csConstraint_fromstr(str):
r"""R1csConstraint_fromstr(std::string const & str) -> R1csConstraint"""
return _alt_bn128.R1csConstraint_fromstr(str)
class R1csConstraintSystem(object):
r"""Proxy of C++ libsnark::r1cs_constraint_system< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def write(self, *args):
r"""write(R1csConstraintSystem self, std::ostream & str=std::cout)"""
return _alt_bn128.R1csConstraintSystem_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> R1csConstraintSystem"""
return _alt_bn128.R1csConstraintSystem_read(*args)
def str(self):
r"""str(R1csConstraintSystem self) -> std::string"""
return _alt_bn128.R1csConstraintSystem_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> R1csConstraintSystem"""
return _alt_bn128.R1csConstraintSystem_fromstr(str)
def __init__(self):
r"""__init__(R1csConstraintSystem self) -> R1csConstraintSystem"""
_alt_bn128.R1csConstraintSystem_swiginit(self, _alt_bn128.new_R1csConstraintSystem())
__swig_destroy__ = _alt_bn128.delete_R1csConstraintSystem
# Register R1csConstraintSystem in _alt_bn128:
_alt_bn128.R1csConstraintSystem_swigregister(R1csConstraintSystem)
def R1csConstraintSystem_read(*args):
r"""R1csConstraintSystem_read(std::istream & str=std::cin) -> R1csConstraintSystem"""
return _alt_bn128.R1csConstraintSystem_read(*args)
def R1csConstraintSystem_fromstr(str):
r"""R1csConstraintSystem_fromstr(std::string const & str) -> R1csConstraintSystem"""
return _alt_bn128.R1csConstraintSystem_fromstr(str)
class R1csPrimaryInput(object):
r"""Proxy of C++ libsnark::r1cs_primary_input< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def size(self):
r"""size(R1csPrimaryInput self) -> int"""
return _alt_bn128.R1csPrimaryInput_size(self)
def at(self, index):
r"""at(R1csPrimaryInput self, int index) -> Ft"""
return _alt_bn128.R1csPrimaryInput_at(self, index)
def write(self, *args):
r"""write(R1csPrimaryInput self, std::ostream & str=std::cout)"""
return _alt_bn128.R1csPrimaryInput_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> R1csPrimaryInput"""
return _alt_bn128.R1csPrimaryInput_read(*args)
def str(self):
r"""str(R1csPrimaryInput self) -> std::string"""
return _alt_bn128.R1csPrimaryInput_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> R1csPrimaryInput"""
return _alt_bn128.R1csPrimaryInput_fromstr(str)
def __init__(self):
r"""__init__(R1csPrimaryInput self) -> R1csPrimaryInput"""
_alt_bn128.R1csPrimaryInput_swiginit(self, _alt_bn128.new_R1csPrimaryInput())
__swig_destroy__ = _alt_bn128.delete_R1csPrimaryInput
# Register R1csPrimaryInput in _alt_bn128:
_alt_bn128.R1csPrimaryInput_swigregister(R1csPrimaryInput)
def R1csPrimaryInput_read(*args):
r"""R1csPrimaryInput_read(std::istream & str=std::cin) -> R1csPrimaryInput"""
return _alt_bn128.R1csPrimaryInput_read(*args)
def R1csPrimaryInput_fromstr(str):
r"""R1csPrimaryInput_fromstr(std::string const & str) -> R1csPrimaryInput"""
return _alt_bn128.R1csPrimaryInput_fromstr(str)
class R1csAuxiliaryInput(object):
r"""Proxy of C++ libsnark::r1cs_auxiliary_input< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def size(self):
r"""size(R1csAuxiliaryInput self) -> int"""
return _alt_bn128.R1csAuxiliaryInput_size(self)
def at(self, index):
r"""at(R1csAuxiliaryInput self, int index) -> Ft"""
return _alt_bn128.R1csAuxiliaryInput_at(self, index)
def write(self, *args):
r"""write(R1csAuxiliaryInput self, std::ostream & str=std::cout)"""
return _alt_bn128.R1csAuxiliaryInput_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> R1csAuxiliaryInput"""
return _alt_bn128.R1csAuxiliaryInput_read(*args)
def str(self):
r"""str(R1csAuxiliaryInput self) -> std::string"""
return _alt_bn128.R1csAuxiliaryInput_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> R1csAuxiliaryInput"""
return _alt_bn128.R1csAuxiliaryInput_fromstr(str)
def __init__(self):
r"""__init__(R1csAuxiliaryInput self) -> R1csAuxiliaryInput"""
_alt_bn128.R1csAuxiliaryInput_swiginit(self, _alt_bn128.new_R1csAuxiliaryInput())
__swig_destroy__ = _alt_bn128.delete_R1csAuxiliaryInput
# Register R1csAuxiliaryInput in _alt_bn128:
_alt_bn128.R1csAuxiliaryInput_swigregister(R1csAuxiliaryInput)
def R1csAuxiliaryInput_read(*args):
r"""R1csAuxiliaryInput_read(std::istream & str=std::cin) -> R1csAuxiliaryInput"""
return _alt_bn128.R1csAuxiliaryInput_read(*args)
def R1csAuxiliaryInput_fromstr(str):
r"""R1csAuxiliaryInput_fromstr(std::string const & str) -> R1csAuxiliaryInput"""
return _alt_bn128.R1csAuxiliaryInput_fromstr(str)
class Protoboard(object):
r"""Proxy of C++ libsnark::protoboard< Ft > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
r"""__init__(Protoboard self) -> Protoboard"""
_alt_bn128.Protoboard_swiginit(self, _alt_bn128.new_Protoboard())
def val(self, var):
r"""val(Protoboard self, PbVariable var) -> Ft"""
return _alt_bn128.Protoboard_val(self, var)
def add_r1cs_constraint(self, *args):
r"""add_r1cs_constraint(Protoboard self, R1csConstraint constr, std::string const & annotation="")"""
return _alt_bn128.Protoboard_add_r1cs_constraint(self, *args)
def is_satisfied(self):
r"""is_satisfied(Protoboard self) -> bool"""
return _alt_bn128.Protoboard_is_satisfied(self)
def dump_variables(self):
r"""dump_variables(Protoboard self)"""
return _alt_bn128.Protoboard_dump_variables(self)
def num_constraints(self):
r"""num_constraints(Protoboard self) -> size_t"""
return _alt_bn128.Protoboard_num_constraints(self)
def num_inputs(self):
r"""num_inputs(Protoboard self) -> size_t"""
return _alt_bn128.Protoboard_num_inputs(self)
def num_variables(self):
r"""num_variables(Protoboard self) -> size_t"""
return _alt_bn128.Protoboard_num_variables(self)
def set_input_sizes(self, primary_input_size):
r"""set_input_sizes(Protoboard self, size_t const primary_input_size)"""
return _alt_bn128.Protoboard_set_input_sizes(self, primary_input_size)
def primary_input(self):
r"""primary_input(Protoboard self) -> R1csPrimaryInput"""
return _alt_bn128.Protoboard_primary_input(self)
def auxiliary_input(self):
r"""auxiliary_input(Protoboard self) -> R1csAuxiliaryInput"""
return _alt_bn128.Protoboard_auxiliary_input(self)
def get_constraint_system(self):
r"""get_constraint_system(Protoboard self) -> R1csConstraintSystem"""
return _alt_bn128.Protoboard_get_constraint_system(self)
def setval(self, varn, valu):
r"""setval(Protoboard self, PbVariable varn, Ft valu)"""
return _alt_bn128.Protoboard_setval(self, varn, valu)
__swig_destroy__ = _alt_bn128.delete_Protoboard
# Register Protoboard in _alt_bn128:
_alt_bn128.Protoboard_swigregister(Protoboard)
class ProtoboardPub(Protoboard):
r"""Proxy of C++ ProtoboardPub class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def setpublic(self, var):
r"""setpublic(ProtoboardPub self, PbVariable var)"""
return _alt_bn128.ProtoboardPub_setpublic(self, var)
def get_constraint_system_pubs(self):
r"""get_constraint_system_pubs(ProtoboardPub self) -> R1csConstraintSystem"""
return _alt_bn128.ProtoboardPub_get_constraint_system_pubs(self)
def primary_input_pubs(self):
r"""primary_input_pubs(ProtoboardPub self) -> R1csPrimaryInput"""
return _alt_bn128.ProtoboardPub_primary_input_pubs(self)
def auxiliary_input_pubs(self):
r"""auxiliary_input_pubs(ProtoboardPub self) -> R1csAuxiliaryInput"""
return _alt_bn128.ProtoboardPub_auxiliary_input_pubs(self)
def __init__(self):
r"""__init__(ProtoboardPub self) -> ProtoboardPub"""
_alt_bn128.ProtoboardPub_swiginit(self, _alt_bn128.new_ProtoboardPub())
__swig_destroy__ = _alt_bn128.delete_ProtoboardPub
# Register ProtoboardPub in _alt_bn128:
_alt_bn128.ProtoboardPub_swigregister(ProtoboardPub)
class ZKProof(object):
r"""Proxy of C++ libsnark::r1cs_ppzksnark_proof< libff::alt_bn128_pp > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
g_A = property(_alt_bn128.ZKProof_g_A_get, _alt_bn128.ZKProof_g_A_set, doc=r"""g_A : libsnark::knowledge_commitment<(libff::G1<(libff::alt_bn128_pp)>,libff::G1<(libff::alt_bn128_pp)>)>""")
g_B = property(_alt_bn128.ZKProof_g_B_get, _alt_bn128.ZKProof_g_B_set, doc=r"""g_B : libsnark::knowledge_commitment<(libff::G2<(libff::alt_bn128_pp)>,libff::G1<(libff::alt_bn128_pp)>)>""")
g_C = property(_alt_bn128.ZKProof_g_C_get, _alt_bn128.ZKProof_g_C_set, doc=r"""g_C : libsnark::knowledge_commitment<(libff::G1<(libff::alt_bn128_pp)>,libff::G1<(libff::alt_bn128_pp)>)>""")
g_H = property(_alt_bn128.ZKProof_g_H_get, _alt_bn128.ZKProof_g_H_set, doc=r"""g_H : libff::G1<(libff::alt_bn128_pp)>""")
g_K = property(_alt_bn128.ZKProof_g_K_get, _alt_bn128.ZKProof_g_K_set, doc=r"""g_K : libff::G1<(libff::alt_bn128_pp)>""")
def write(self, *args):
r"""write(ZKProof self, std::ostream & str=std::cout)"""
return _alt_bn128.ZKProof_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> ZKProof"""
return _alt_bn128.ZKProof_read(*args)
def str(self):
r"""str(ZKProof self) -> std::string"""
return _alt_bn128.ZKProof_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> ZKProof"""
return _alt_bn128.ZKProof_fromstr(str)
def __init__(self):
r"""__init__(ZKProof self) -> ZKProof"""
_alt_bn128.ZKProof_swiginit(self, _alt_bn128.new_ZKProof())
__swig_destroy__ = _alt_bn128.delete_ZKProof
# Register ZKProof in _alt_bn128:
_alt_bn128.ZKProof_swigregister(ZKProof)
def ZKProof_read(*args):
r"""ZKProof_read(std::istream & str=std::cin) -> ZKProof"""
return _alt_bn128.ZKProof_read(*args)
def ZKProof_fromstr(str):
r"""ZKProof_fromstr(std::string const & str) -> ZKProof"""
return _alt_bn128.ZKProof_fromstr(str)
class ZKKeypair(object):
r"""Proxy of C++ libsnark::r1cs_ppzksnark_keypair< libff::alt_bn128_pp > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
pk = property(_alt_bn128.ZKKeypair_pk_get, _alt_bn128.ZKKeypair_pk_set, doc=r"""pk : libsnark::r1cs_ppzksnark_proving_key<(libff::alt_bn128_pp)>""")
vk = property(_alt_bn128.ZKKeypair_vk_get, _alt_bn128.ZKKeypair_vk_set, doc=r"""vk : libsnark::r1cs_ppzksnark_verification_key<(libff::alt_bn128_pp)>""")
def __init__(self, other):
r"""__init__(ZKKeypair self, ZKKeypair other) -> ZKKeypair"""
_alt_bn128.ZKKeypair_swiginit(self, _alt_bn128.new_ZKKeypair(other))
__swig_destroy__ = _alt_bn128.delete_ZKKeypair
# Register ZKKeypair in _alt_bn128:
_alt_bn128.ZKKeypair_swigregister(ZKKeypair)
class ZKVerificationKey(object):
r"""Proxy of C++ libsnark::r1cs_ppzksnark_verification_key< libff::alt_bn128_pp > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
alphaA_g2 = property(_alt_bn128.ZKVerificationKey_alphaA_g2_get, _alt_bn128.ZKVerificationKey_alphaA_g2_set, doc=r"""alphaA_g2 : libff::G2<(libff::alt_bn128_pp)>""")
alphaB_g1 = property(_alt_bn128.ZKVerificationKey_alphaB_g1_get, _alt_bn128.ZKVerificationKey_alphaB_g1_set, doc=r"""alphaB_g1 : libff::G1<(libff::alt_bn128_pp)>""")
alphaC_g2 = property(_alt_bn128.ZKVerificationKey_alphaC_g2_get, _alt_bn128.ZKVerificationKey_alphaC_g2_set, doc=r"""alphaC_g2 : libff::G2<(libff::alt_bn128_pp)>""")
gamma_g2 = property(_alt_bn128.ZKVerificationKey_gamma_g2_get, _alt_bn128.ZKVerificationKey_gamma_g2_set, doc=r"""gamma_g2 : libff::G2<(libff::alt_bn128_pp)>""")
gamma_beta_g1 = property(_alt_bn128.ZKVerificationKey_gamma_beta_g1_get, _alt_bn128.ZKVerificationKey_gamma_beta_g1_set, doc=r"""gamma_beta_g1 : libff::G1<(libff::alt_bn128_pp)>""")
gamma_beta_g2 = property(_alt_bn128.ZKVerificationKey_gamma_beta_g2_get, _alt_bn128.ZKVerificationKey_gamma_beta_g2_set, doc=r"""gamma_beta_g2 : libff::G2<(libff::alt_bn128_pp)>""")
rC_Z_g2 = property(_alt_bn128.ZKVerificationKey_rC_Z_g2_get, _alt_bn128.ZKVerificationKey_rC_Z_g2_set, doc=r"""rC_Z_g2 : libff::G2<(libff::alt_bn128_pp)>""")
def write(self, *args):
r"""write(ZKVerificationKey self, std::ostream & str=std::cout)"""
return _alt_bn128.ZKVerificationKey_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> ZKVerificationKey"""
return _alt_bn128.ZKVerificationKey_read(*args)
def str(self):
r"""str(ZKVerificationKey self) -> std::string"""
return _alt_bn128.ZKVerificationKey_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> ZKVerificationKey"""
return _alt_bn128.ZKVerificationKey_fromstr(str)
def encoded_IC_query_size(self):
r"""encoded_IC_query_size(ZKVerificationKey self) -> int"""
return _alt_bn128.ZKVerificationKey_encoded_IC_query_size(self)
def encoded_IC_query(self, ix):
r"""encoded_IC_query(ZKVerificationKey self, int ix) -> G1"""
return _alt_bn128.ZKVerificationKey_encoded_IC_query(self, ix)
def __init__(self):
r"""__init__(ZKVerificationKey self) -> ZKVerificationKey"""
_alt_bn128.ZKVerificationKey_swiginit(self, _alt_bn128.new_ZKVerificationKey())
__swig_destroy__ = _alt_bn128.delete_ZKVerificationKey
# Register ZKVerificationKey in _alt_bn128:
_alt_bn128.ZKVerificationKey_swigregister(ZKVerificationKey)
def ZKVerificationKey_read(*args):
r"""ZKVerificationKey_read(std::istream & str=std::cin) -> ZKVerificationKey"""
return _alt_bn128.ZKVerificationKey_read(*args)
def ZKVerificationKey_fromstr(str):
r"""ZKVerificationKey_fromstr(std::string const & str) -> ZKVerificationKey"""
return _alt_bn128.ZKVerificationKey_fromstr(str)
class ZKProvingKey(object):
r"""Proxy of C++ libsnark::r1cs_ppzksnark_proving_key< libff::alt_bn128_pp > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def write(self, *args):
r"""write(ZKProvingKey self, std::ostream & str=std::cout)"""
return _alt_bn128.ZKProvingKey_write(self, *args)
@staticmethod
def read(*args):
r"""read(std::istream & str=std::cin) -> ZKProvingKey"""
return _alt_bn128.ZKProvingKey_read(*args)
def str(self):
r"""str(ZKProvingKey self) -> std::string"""
return _alt_bn128.ZKProvingKey_str(self)
@staticmethod
def fromstr(str):
r"""fromstr(std::string const & str) -> ZKProvingKey"""
return _alt_bn128.ZKProvingKey_fromstr(str)
def __init__(self):
r"""__init__(ZKProvingKey self) -> ZKProvingKey"""
_alt_bn128.ZKProvingKey_swiginit(self, _alt_bn128.new_ZKProvingKey())
__swig_destroy__ = _alt_bn128.delete_ZKProvingKey
# Register ZKProvingKey in _alt_bn128:
_alt_bn128.ZKProvingKey_swigregister(ZKProvingKey)
def ZKProvingKey_read(*args):
r"""ZKProvingKey_read(std::istream & str=std::cin) -> ZKProvingKey"""
return _alt_bn128.ZKProvingKey_read(*args)
def ZKProvingKey_fromstr(str):
r"""ZKProvingKey_fromstr(std::string const & str) -> ZKProvingKey"""
return _alt_bn128.ZKProvingKey_fromstr(str)
def zk_generator(cs):
r"""zk_generator(R1csConstraintSystem cs) -> ZKKeypair"""
return _alt_bn128.zk_generator(cs)
def zk_prover(pk, primary_input, auxiliary_input):
r"""zk_prover(ZKProvingKey pk, R1csPrimaryInput primary_input, R1csAuxiliaryInput auxiliary_input) -> ZKProof"""
return _alt_bn128.zk_prover(pk, primary_input, auxiliary_input)
def zk_verifier_weak_IC(vk, primary_input, proof):
r"""zk_verifier_weak_IC(ZKVerificationKey vk, R1csPrimaryInput primary_input, ZKProof proof) -> bool"""
return _alt_bn128.zk_verifier_weak_IC(vk, primary_input, proof)
def zk_verifier_strong_IC(vk, primary_input, proof):
r"""zk_verifier_strong_IC(ZKVerificationKey vk, R1csPrimaryInput primary_input, ZKProof proof) -> bool"""
return _alt_bn128.zk_verifier_strong_IC(vk, primary_input, proof)
def zk_read_key(ekfile, cs=None):
r"""zk_read_key(char const * ekfile, R1csConstraintSystem cs=None) -> ZKKeypair"""
return _alt_bn128.zk_read_key(ekfile, cs)
def zk_write_keys(keypair, vkfile=None, ekfile=None):
r"""zk_write_keys(ZKKeypair keypair, char const * vkfile=None, char const * ekfile=None)"""
return _alt_bn128.zk_write_keys(keypair, vkfile, ekfile)
def zk_write_proof(proof, pubvals, logfile):
r"""zk_write_proof(ZKProof proof, R1csPrimaryInput pubvals, char const * logfile)"""
return _alt_bn128.zk_write_proof(proof, pubvals, logfile)
class ZKGGProof(object):
r"""Proxy of C++ libsnark::r1cs_gg_ppzksnark_proof< libff::alt_bn128_pp > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
r"""__init__(ZKGGProof self) -> ZKGGProof"""
_alt_bn128.ZKGGProof_swiginit(self, _alt_bn128.new_ZKGGProof())
__swig_destroy__ = _alt_bn128.delete_ZKGGProof
# Register ZKGGProof in _alt_bn128:
_alt_bn128.ZKGGProof_swigregister(ZKGGProof)
class ZKGGKeypair(object):
r"""Proxy of C++ libsnark::r1cs_gg_ppzksnark_keypair< libff::alt_bn128_pp > class."""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
pk = property(_alt_bn128.ZKGGKeypair_pk_get, _alt_bn128.ZKGGKeypair_pk_set, doc=r"""pk : libsnark::r1cs_gg_ppzksnark_proving_key<(libff::alt_bn128_pp)>""")
vk = property(_alt_bn128.ZKGGKeypair_vk_get, _alt_bn128.ZKGGKeypair_vk_set, doc=r"""vk : libsnark::r1cs_gg_ppzksnark_verification_key<(libff::alt_bn128_pp)>""")
def __init__(self, other):
r"""__init__(ZKGGKeypair self, ZKGGKeypair other) -> ZKGGKeypair"""
_alt_bn128.ZKGGKeypair_swiginit(self, _alt_bn128.new_ZKGGKeypair(other))
__swig_destroy__ = _alt_bn128.delete_ZKGGKeypair
# Register ZKGGKeypair in _alt_bn128:
_alt_bn128.ZKGGKeypair_swigregister(ZKGGKeypair)
def zkgg_generator(cs):
r"""zkgg_generator(R1csConstraintSystem cs) -> ZKGGKeypair"""
return _alt_bn128.zkgg_generator(cs)
def zkgg_prover(pk, primary_input, auxiliary_input):
r"""zkgg_prover(libsnark::r1cs_gg_ppzksnark_proving_key< libff::alt_bn128_pp > const & pk, R1csPrimaryInput primary_input, R1csAuxiliaryInput auxiliary_input) -> ZKGGProof"""
return _alt_bn128.zkgg_prover(pk, primary_input, auxiliary_input)
def zkgg_verifier_weak_IC(vk, primary_input, proof):
r"""zkgg_verifier_weak_IC(libsnark::r1cs_gg_ppzksnark_verification_key< libff::alt_bn128_pp > const & vk, R1csPrimaryInput primary_input, ZKGGProof proof) -> bool"""
return _alt_bn128.zkgg_verifier_weak_IC(vk, primary_input, proof)
def zkgg_verifier_strong_IC(vk, primary_input, proof):
r"""zkgg_verifier_strong_IC(libsnark::r1cs_gg_ppzksnark_verification_key< libff::alt_bn128_pp > const & vk, R1csPrimaryInput primary_input, ZKGGProof proof) -> bool"""
return _alt_bn128.zkgg_verifier_strong_IC(vk, primary_input, proof)
def zkgg_read_key(ekfile, cs=None):
r"""zkgg_read_key(char const * ekfile, R1csConstraintSystem cs=None) -> ZKGGKeypair"""
return _alt_bn128.zkgg_read_key(ekfile, cs)
def zkgg_write_keys(keypair, vkfile=None, ekfile=None):
r"""zkgg_write_keys(ZKGGKeypair keypair, char const * vkfile=None, char const * ekfile=None)"""
return _alt_bn128.zkgg_write_keys(keypair, vkfile, ekfile)
def zkgg_write_proof(proof, pubvals, logfile):
r"""zkgg_write_proof(ZKGGProof proof, R1csPrimaryInput pubvals, char const * logfile)"""
return _alt_bn128.zkgg_write_proof(proof, pubvals, logfile)