aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/rctSigs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ringct/rctSigs.cpp')
-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