forked from mrtuborg/libSTARK
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBairWitnessChecker_UTEST.hpp
148 lines (134 loc) · 4.85 KB
/
BairWitnessChecker_UTEST.hpp
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
#ifndef Bair_UTEST_HPP
#define Bair_UTEST_HPP
#include <languages/Bair/BairInstance.hpp>
#include <languages/Bair/BairWitness.hpp>
namespace PCP_UTESTS{
/***************************************************
*
* This generates a valid Bair pair,
* with no constraints and no permutations.
* the only relevant test here is boundary constraints.
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_valid_boundary();
/***************************************************
*
* This generates an invalid Bair pair,
* with no constraints and no permutations.
* the only relevant test here is boundary constraints.
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_invalid_boundary();
/***************************************************
*
* This generates a valid Bair pair,
* with some empty constraints and valid permutations.
* The boundary is empty.
* The coloring is random.
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_valid_permutations();
/***************************************************
*
* This generates an invalid Bair pair,
* with some empty constraints and valid permutations,
* except of one, which is not a permutation.
* The boundary is empty.
* The coloring is random.
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_invalid_permutations();
/***************************************************
*
* This generates a valid Bair pair,
* with some constraints and valid permutations.
* The boundary is empty.
* The coloring is random.
*
* Generation method:
* generates all parameters but the
* constraint systems.
* And defines each constraint system to be satisfied
* exactly from the parameters given.
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_valid_constraints();
/***************************************************
*
* This generates an invalid Bair pair,
* with constraints and valid permutations.
* The boundary is empty.
* The coloring is random.
*
* Generation method:
* generates all parameters but the
* constraint systems.
* And defines each constraint system to be satisfied
* exactly from the parameters given,
* except of one victim constraints system that is
* chosen randomly, one victim index 'i',
* such that the test of that index
* (color(i),color(perm(i))) will fail.
*
* In this case the victim is constraintsAssignment
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_invalid_constraints_Assignment();
/***************************************************
*
* This generates an invalid Bair pair,
* with constraints and valid permutations.
* The boundary is empty.
* The coloring is random.
*
* Generation method:
* generates all parameters but the
* constraint systems.
* And defines each constraint system to be satisfied
* exactly from the parameters given,
* except of one victim constraints system that is
* chosen randomly, one victim index 'i',
* such that the test of that index
* (color(i),color(perm(i))) will fail.
*
* In this case the victim is constraintsPermutation
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_invalid_constraints_Permutation();
/***************************************************
*
* This generates an invalid Bair pair,
* with constraints and valid permutations.
* The boundary is empty.
* The coloring is random.
*
* Generation method:
* generates all parameters but the
* constraint systems.
* And defines each constraint system to be satisfied
* exactly from the parameters given,
* except of one victim constraints system that is
* chosen randomly, one victim index 'i',
* such that the test of that index
* (color(i),color(perm(i))) will fail.
*
* In this case the victims are both constraintsAssignment & constraintsPermutation
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_invalid_constraints_both();
/***************************************************
*
* This generates a Bair pair
* from EGCP pair that is reduced from TinyRAM
* Should be a valid pair
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> reduceFromTinyRAM(const int t);
/***************************************************
*
* This generates some valid Bair pair
*
***************************************************/
std::pair<libstark::BairInstance,libstark::BairWitness> generate_valid_pair();
} //PCP_UTEST namespace
#endif // Bair_UTEST_HPP