aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/rctSigs.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-06-15 23:37:13 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:28:37 +0100
commitdc4aad7eb5fffa450d4c5eb094cf962e45b2f43a (patch)
treee8fc99783d63582ff026adee2584478b0e799933 /src/ringct/rctSigs.cpp
parentdb_lmdb: update reset for recent db changes (diff)
downloadmonero-dc4aad7eb5fffa450d4c5eb094cf962e45b2f43a.tar.xz
add rct to the protocol
It is not yet constrained to a fork, so don't use on the real network or you'll be orphaned or rejected.
Diffstat (limited to '')
-rw-r--r--src/ringct/rctSigs.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp
index 7b83ca0e2..358feeb5d 100644
--- a/src/ringct/rctSigs.cpp
+++ b/src/ringct/rctSigs.cpp
@@ -537,22 +537,30 @@ namespace rct {
bool verRct(const rctSig & rv) {
CHECK_AND_ASSERT_THROW_MES(rv.outPk.size() == rv.rangeSigs.size(), "Mismatched sizes of rv.outPk and rv.rangeSigs");
- size_t i = 0;
- bool rvb = true;
- bool tmp;
- DP("range proofs verified?");
- for (i = 0; i < rv.outPk.size(); i++) {
- tmp = verRange(rv.outPk[i].mask, rv.rangeSigs[i]);
- DP(tmp);
- rvb = (rvb && tmp);
- }
- //compute txn fee
- key txnFeeKey = scalarmultH(d2h(rv.txnFee));
- bool mgVerd = verRctMG(rv.MG, rv.mixRing, rv.outPk, txnFeeKey);
- DP("mg sig verified?");
- DP(mgVerd);
+ // some rct ops can throw
+ try
+ {
+ size_t i = 0;
+ bool rvb = true;
+ bool tmp;
+ DP("range proofs verified?");
+ for (i = 0; i < rv.outPk.size(); i++) {
+ tmp = verRange(rv.outPk[i].mask, rv.rangeSigs[i]);
+ DP(tmp);
+ rvb = (rvb && tmp);
+ }
+ //compute txn fee
+ key txnFeeKey = scalarmultH(d2h(rv.txnFee));
+ bool mgVerd = verRctMG(rv.MG, rv.mixRing, rv.outPk, txnFeeKey);
+ DP("mg sig verified?");
+ DP(mgVerd);
- return (rvb && mgVerd);
+ return (rvb && mgVerd);
+ }
+ catch(...)
+ {
+ return false;
+ }
}
//RingCT protocol