aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/rctTypes.h
diff options
context:
space:
mode:
authorSarang Noether <32460187+SarangNoether@users.noreply.github.com>2020-12-12 19:37:16 -0500
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2022-04-04 08:23:21 +0000
commitbd27debb2d480845acdd20c4d02509d55fd4f188 (patch)
treec33c0efa19af576e05dbef7731f1826e0a522a02 /src/ringct/rctTypes.h
parentMerge pull request #8216 (diff)
downloadmonero-bd27debb2d480845acdd20c4d02509d55fd4f188.tar.xz
Bulletproofs+
Diffstat (limited to 'src/ringct/rctTypes.h')
-rw-r--r--src/ringct/rctTypes.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h
index 278ff4164..dc69990f0 100644
--- a/src/ringct/rctTypes.h
+++ b/src/ringct/rctTypes.h
@@ -238,6 +238,39 @@ namespace rct {
END_SERIALIZE()
};
+ struct BulletproofPlus
+ {
+ rct::keyV V;
+ rct::key A, A1, B;
+ rct::key r1, s1, d1;
+ rct::keyV L, R;
+
+ BulletproofPlus():
+ A({}), A1({}), B({}), r1({}), s1({}), d1({}) {}
+ BulletproofPlus(const rct::key &V, const rct::key &A, const rct::key &A1, const rct::key &B, const rct::key &r1, const rct::key &s1, const rct::key &d1, const rct::keyV &L, const rct::keyV &R):
+ V({V}), A(A), A1(A1), B(B), r1(r1), s1(s1), d1(d1), L(L), R(R) {}
+ BulletproofPlus(const rct::keyV &V, const rct::key &A, const rct::key &A1, const rct::key &B, const rct::key &r1, const rct::key &s1, const rct::key &d1, const rct::keyV &L, const rct::keyV &R):
+ V(V), A(A), A1(A1), B(B), r1(r1), s1(s1), d1(d1), L(L), R(R) {}
+
+ bool operator==(const BulletproofPlus &other) const { return V == other.V && A == other.A && A1 == other.A1 && B == other.B && r1 == other.r1 && s1 == other.s1 && d1 == other.d1 && L == other.L && R == other.R; }
+
+ BEGIN_SERIALIZE_OBJECT()
+ // Commitments aren't saved, they're restored via outPk
+ // FIELD(V)
+ FIELD(A)
+ FIELD(A1)
+ FIELD(B)
+ FIELD(r1)
+ FIELD(s1)
+ FIELD(d1)
+ FIELD(L)
+ FIELD(R)
+
+ if (L.empty() || L.size() != R.size())
+ return false;
+ END_SERIALIZE()
+ };
+
size_t n_bulletproof_amounts(const Bulletproof &proof);
size_t n_bulletproof_max_amounts(const Bulletproof &proof);
size_t n_bulletproof_amounts(const std::vector<Bulletproof> &proofs);