mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-16 07:35:16 -05:00
enhance: Refactor the cpp code to be more generic and easy to generate
This commit is contained in:
12
cpp/gen_header.py
Normal file
12
cpp/gen_header.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import sys, json;
|
||||
|
||||
def print_curve(data):
|
||||
print(f'\tSecurityCurve({data["security_level"]},{data["slope"]}, {data["bias"]}, {data["minimal_lwe_dimension"]}, KeyFormat::BINARY),')
|
||||
|
||||
def print_cpp_curves_declaration(datas):
|
||||
print("std::vector<SecurityCurve> curves {")
|
||||
for data in datas:
|
||||
print_curve(data)
|
||||
print("}\n")
|
||||
|
||||
print_cpp_curves_declaration(json.load(sys.stdin))
|
||||
Reference in New Issue
Block a user