|
@@ -41,13 +41,6 @@ Scalar oracle(const std::string& input)
|
|
return output;
|
|
return output;
|
|
}
|
|
}
|
|
|
|
|
|
-Proof::Proof()
|
|
|
|
-{ }
|
|
|
|
-
|
|
|
|
-Proof::Proof(std::string hbc)
|
|
|
|
-: hbc(hbc)
|
|
|
|
-{ }
|
|
|
|
-
|
|
|
|
void Proof::clear()
|
|
void Proof::clear()
|
|
{
|
|
{
|
|
hbc.clear();
|
|
hbc.clear();
|
|
@@ -59,30 +52,39 @@ void Proof::clear()
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& os, const Proof& output)
|
|
std::ostream& operator<<(std::ostream& os, const Proof& output)
|
|
{
|
|
{
|
|
- if (!output.hbc.empty())
|
|
+ BinaryBool hbc(!output.hbc.empty());
|
|
|
|
+ os << hbc;
|
|
|
|
+
|
|
|
|
+ BinarySizeT numElements;
|
|
|
|
+
|
|
|
|
+ if (hbc.val())
|
|
{
|
|
{
|
|
- os << true;
|
|
+ numElements.set(output.hbc.length());
|
|
- os << output.hbc.size();
|
|
+
|
|
|
|
+ os << numElements;
|
|
os << output.hbc;
|
|
os << output.hbc;
|
|
|
|
+
|
|
return os;
|
|
return os;
|
|
}
|
|
}
|
|
|
|
|
|
- os << false;
|
|
+ numElements.set(output.curvepointUniversals.size());
|
|
-
|
|
+ os << numElements;
|
|
- os << output.curvepointUniversals.size();
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
- for (size_t i = 0; i < output.curvepointUniversals.size(); i++)
|
|
|
|
os << output.curvepointUniversals[i];
|
|
os << output.curvepointUniversals[i];
|
|
|
|
|
|
- os << output.curveBipointUniversals.size();
|
|
+ numElements.set(output.curveBipointUniversals.size());
|
|
- for (size_t i = 0; i < output.curveBipointUniversals.size(); i++)
|
|
+ os << numElements;
|
|
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
os << output.curveBipointUniversals[i];
|
|
os << output.curveBipointUniversals[i];
|
|
|
|
|
|
- os << output.challengeParts.size();
|
|
+ numElements.set(output.challengeParts.size());
|
|
- for (size_t i = 0; i < output.challengeParts.size(); i++)
|
|
+ os << numElements;
|
|
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
os << output.challengeParts[i];
|
|
os << output.challengeParts[i];
|
|
|
|
|
|
- os << output.responseParts.size();
|
|
+ numElements.set(output.responseParts.size());
|
|
- for (size_t i = 0; i < output.responseParts.size(); i++)
|
|
+ os << numElements;
|
|
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
os << output.responseParts[i];
|
|
os << output.responseParts[i];
|
|
|
|
|
|
return os;
|
|
return os;
|
|
@@ -90,24 +92,24 @@ std::ostream& operator<<(std::ostream& os, const Proof& output)
|
|
|
|
|
|
std::istream& operator>>(std::istream& is, Proof& input)
|
|
std::istream& operator>>(std::istream& is, Proof& input)
|
|
{
|
|
{
|
|
- bool hbc;
|
|
+ BinaryBool hbc;
|
|
is >> hbc;
|
|
is >> hbc;
|
|
- if (hbc)
|
|
+ if (hbc.val())
|
|
{
|
|
{
|
|
- size_t numBytes;
|
|
+ BinarySizeT numBytes;
|
|
is >> numBytes;
|
|
is >> numBytes;
|
|
|
|
|
|
- char* buffer = new char[numBytes + 1];
|
|
+ char* buffer = new char[numBytes.val() + 1];
|
|
- is.read(buffer, numBytes);
|
|
+ is.read(buffer, numBytes.val());
|
|
input.hbc = buffer;
|
|
input.hbc = buffer;
|
|
delete buffer;
|
|
delete buffer;
|
|
|
|
|
|
return is;
|
|
return is;
|
|
}
|
|
}
|
|
|
|
|
|
- size_t numElements;
|
|
+ BinarySizeT numElements;
|
|
is >> numElements;
|
|
is >> numElements;
|
|
- for (size_t i = 0; i < numElements; i++)
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
{
|
|
{
|
|
Twistpoint x;
|
|
Twistpoint x;
|
|
is >> x;
|
|
is >> x;
|
|
@@ -115,7 +117,7 @@ std::istream& operator>>(std::istream& is, Proof& input)
|
|
}
|
|
}
|
|
|
|
|
|
is >> numElements;
|
|
is >> numElements;
|
|
- for (size_t i = 0; i < numElements; i++)
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
{
|
|
{
|
|
TwistBipoint x;
|
|
TwistBipoint x;
|
|
is >> x;
|
|
is >> x;
|
|
@@ -123,7 +125,7 @@ std::istream& operator>>(std::istream& is, Proof& input)
|
|
}
|
|
}
|
|
|
|
|
|
is >> numElements;
|
|
is >> numElements;
|
|
- for (size_t i = 0; i < numElements; i++)
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
{
|
|
{
|
|
Scalar x;
|
|
Scalar x;
|
|
is >> x;
|
|
is >> x;
|
|
@@ -131,7 +133,7 @@ std::istream& operator>>(std::istream& is, Proof& input)
|
|
}
|
|
}
|
|
|
|
|
|
is >> numElements;
|
|
is >> numElements;
|
|
- for (size_t i = 0; i < numElements; i++)
|
|
+ for (size_t i = 0; i < numElements.val(); i++)
|
|
{
|
|
{
|
|
Scalar x;
|
|
Scalar x;
|
|
is >> x;
|
|
is >> x;
|