aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-06-05 11:24:04 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:28:14 +0100
commitc3a2e1450ad063d97a53e7849d1f618eac4c98e8 (patch)
tree39ecb3601f94ce11ff9751fd8fd1ea891ca5159d
parentblockchain_db: add functions for adding/removing/getting rct commitments (diff)
downloadmonero-c3a2e1450ad063d97a53e7849d1f618eac4c98e8.tar.xz
ringct: add convenience functions to bridge ringct and cryptonote
-rw-r--r--src/ringct/rctTypes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h
index 990d3d064..8be69021b 100644
--- a/src/ringct/rctTypes.h
+++ b/src/ringct/rctTypes.h
@@ -287,6 +287,11 @@ namespace rct {
void b2h(key & amountdh, bits amountb2);
//int[64] to uint long long
xmr_amount b2d(bits amountb);
+
+ static inline bool operator==(const key &k0, const public_key &k1) { return !memcmp(&k0, &k1, 32); }
+ static inline bool operator==(const public_key &k0, const key &k1) { return !memcmp(&k0, &k1, 32); }
+ static inline key pk2rct(const public_key &pk) { key k; memcpy(&k, &pk, 32); return k; }
+ static inline public_key rct2pk(const key &k) { public_key pk; memcpy(&pk, &k, 32); return pk; }
}
template<typename T> std::ostream &print256(std::ostream &o, const T &v);