feat: support signed execution

Author: aPere3 <alexandre.pere@zama.ai>
Co-authored-by: Umut <umutsahin@protonmail.com>
This commit is contained in:
aPere3
2022-09-14 10:35:19 +02:00
committed by Quentin Bourgerie
parent f913c39e5b
commit e95c53f2ff
37 changed files with 1092 additions and 184 deletions

View File

@@ -306,6 +306,7 @@ bool fromJSON(const llvm::json::Value j, CircuitGateShape &v,
llvm::json::Value toJSON(const Encoding &v) {
llvm::json::Object object{
{"precision", v.precision},
{"isSigned", v.isSigned},
};
if (!v.crt.empty()) {
object.insert({"crt", v.crt});
@@ -324,6 +325,12 @@ bool fromJSON(const llvm::json::Value j, Encoding &v, llvm::json::Path p) {
return false;
}
v.precision = precision.getValue();
auto isSigned = obj->getBoolean("isSigned");
if (!isSigned.hasValue()) {
p.report("missing isSigned field");
return false;
}
v.isSigned = isSigned.getValue();
auto crt = obj->getArray("crt");
if (crt != nullptr) {
for (auto dim : *crt) {