|
@@ -88,8 +88,8 @@ Scalar BGNPrivateKey::decrypt(const Quadripoint& ciphertext)
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& os, const BGNPrivateKey& output)
|
|
|
{
|
|
|
- os << output.a1 << output.b1 << output.c1 << output.d1;
|
|
|
- os << output.a2 << output.b2 << output.c2 << output.d2;
|
|
|
+ os << output.a1 << output.b1 << output.c1;
|
|
|
+ os << output.a2 << output.b2 << output.c2;
|
|
|
os << output.pi_1_curvegen;
|
|
|
os << output.pi_2_twistgen;
|
|
|
os << output.pi_T_pairgen;
|
|
@@ -99,8 +99,12 @@ std::ostream& operator<<(std::ostream& os, const BGNPrivateKey& output)
|
|
|
|
|
|
std::istream& operator>>(std::istream& is, BGNPrivateKey& input)
|
|
|
{
|
|
|
- is >> input.a1 >> input.b1 >> input.c1 >> input.d1;
|
|
|
- is >> input.a2 >> input.b2 >> input.c2 >> input.d2;
|
|
|
+ is >> input.a1 >> input.b1 >> input.c1;
|
|
|
+ input.d1 = ((input.b1).fieldMult(input.c1).fieldAdd(Scalar(1))).fieldMult((input.a1).fieldMultInverse());
|
|
|
+
|
|
|
+ is >> input.a2 >> input.b2 >> input.c2;
|
|
|
+ input.d2 = ((input.b2).fieldMult(input.c2).fieldAdd(Scalar(1))).fieldMult((input.a2).fieldMultInverse());
|
|
|
+
|
|
|
is >> input.pi_1_curvegen;
|
|
|
is >> input.pi_2_twistgen;
|
|
|
is >> input.pi_T_pairgen;
|