Skip to content

Commit

Permalink
MxCir update and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ladnir committed Apr 5, 2024
1 parent 1ffddc5 commit c09f5f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cryptoTools/Circuit/MxCircuit.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace osuCrypto
public:

Circuit() = default;
Circuit(Circuit&&) = delete;
Circuit(Circuit&&) = default;
Circuit(const Circuit&) = delete;

enum ValueType
Expand Down Expand Up @@ -414,6 +414,12 @@ namespace osuCrypto

void evaluate(const std::vector<BitVector>& in, std::vector<BitVector>& out)
{

if (mInputs.size() == 0)
throw std::runtime_error("MxCircuit::evaluate(...), zero inputs to cirucit. " LOCATION);
if (mOutputs.size() == 0)
throw std::runtime_error("MxCircuit::evaluate(...), zero output from cirucit. " LOCATION);

if (in.size() != mInputs.size())
throw std::runtime_error("MxCircuit::evaluate(...), number of inputs provided is not correct. " LOCATION);
out.resize(mOutputs.size());
Expand Down
4 changes: 4 additions & 0 deletions cryptoTools/Circuit/MxTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ namespace osuCrypto
std::vector<Bit>& asBits() { return *this; }
const std::vector<Bit>& asBits() const { return *this; }

static BVector makeFromSize(u64 s)
{
return BVector(s);
}
};

// a crtp that implement the integer operations for type C.
Expand Down

0 comments on commit c09f5f5

Please sign in to comment.