Skip to content

Commit

Permalink
enable bls12-381 native field case #54
Browse files Browse the repository at this point in the history
  • Loading branch information
CblPOK-git committed Nov 21, 2023
1 parent 7dbab77 commit d4a25e0
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions bin/assigner/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void print_assignment_table(const assignment_proxy<ArithmetizationType> &table_p
print_hex_byteblob(out, cv.cbegin(), cv.cend(), false);
}

template<typename CurveType, bool PrintCircuitOutput>
template<typename BlueprintFieldType, bool PrintCircuitOutput>
int curve_dependent_main(std::string bytecode_file_name,
std::string public_input_file_name,
std::string assignment_table_file_name,
Expand All @@ -373,7 +373,6 @@ int curve_dependent_main(std::string bytecode_file_name,
bool verbose,
const std::string &policy,
std::uint32_t max_num_provers) {
using BlueprintFieldType = typename CurveType::base_field_type;
constexpr std::size_t WitnessColumns = 15;
constexpr std::size_t PublicInputColumns = 1;
constexpr std::size_t ConstantColumns = 5;
Expand Down Expand Up @@ -635,7 +634,7 @@ int main(int argc, char *argv[]) {
switch (curve_options[elliptic_curve]) {
case 0: {
if (vm.count("print_circuit_output")) {
return curve_dependent_main<typename algebra::curves::pallas, true>(
return curve_dependent_main<typename algebra::curves::pallas::base_field_type, true>(
bytecode_file_name,
public_input_file_name,
assignment_table_file_name,
Expand All @@ -647,7 +646,7 @@ int main(int argc, char *argv[]) {
max_num_provers);
}
else {
return curve_dependent_main<typename algebra::curves::pallas, false>(
return curve_dependent_main<typename algebra::curves::pallas::base_field_type, false>(
bytecode_file_name,
public_input_file_name,
assignment_table_file_name,
Expand All @@ -671,6 +670,31 @@ int main(int argc, char *argv[]) {
case 3: {
UNREACHABLE("bls12-381 curve based circuits are not supported yet");
break;

if (vm.count("print_circuit_output")) {
return curve_dependent_main<typename algebra::fields::bls12_base_field<381>, true>(
bytecode_file_name,
public_input_file_name,
assignment_table_file_name,
circuit_file_name,
stack_size,
vm.count("check"),
vm.count("verbose"),
policy,
max_num_provers);
}
else {
return curve_dependent_main<typename algebra::fields::bls12_base_field<381>, false>(
bytecode_file_name,
public_input_file_name,
assignment_table_file_name,
circuit_file_name,
stack_size,
vm.count("check"),
vm.count("verbose"),
policy,
max_num_provers);
}
}
};

Expand Down

0 comments on commit d4a25e0

Please sign in to comment.