mirror of
https://github.com/circify/circ.git
synced 2026-01-10 06:08:02 -05:00
To reduce CI build time: - Replaced ABY dependency with corresponding binary. - Removed dependencies on KaHIP and KaHyPar for now because these dependencies aren't used upstream. Minor updates: - Updated ABY source to Public branch Note: - The aby_interpreter binary will only work on Linux. We can rebuild the binary from this repo.
43 lines
1017 B
Python
43 lines
1017 B
Python
import os
|
|
from os import path
|
|
|
|
# Gloable variables
|
|
feature_path = ".features.txt"
|
|
mode_path = ".mode.txt"
|
|
|
|
# TODO: add in "kahip", "kahypar" binaries dependencies when adding new MPC changes
|
|
cargo_features = {"aby", "c", "lp", "r1cs", "smt",
|
|
"zok", "datalog", "bellman", "spartan", "poly"}
|
|
|
|
|
|
def save_mode(mode):
|
|
""" Save mode to file """
|
|
with open(mode_path, 'w') as f:
|
|
f.write(mode)
|
|
|
|
|
|
def load_mode():
|
|
""" Load mode from file """
|
|
if path.exists(mode_path):
|
|
with open(mode_path, 'r') as f:
|
|
return f.read().strip()
|
|
else:
|
|
return ""
|
|
|
|
|
|
def save_features(features):
|
|
""" Save features to file """
|
|
with open(feature_path, 'w') as f:
|
|
feature_str = "\n".join(features)
|
|
f.write(feature_str)
|
|
|
|
|
|
def load_features():
|
|
""" Load features from file """
|
|
if path.exists(feature_path):
|
|
with open(feature_path, 'r') as f:
|
|
features = f.read().splitlines()
|
|
return features
|
|
else:
|
|
return []
|