diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-06-29 15:03:00 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-11 13:38:04 +0000 |
commit | c42917624849daeac0b4bc2fb1cd1f2539470b28 (patch) | |
tree | 301e71aef03eb5962360a95e2205432add3c78e9 /src/ringct/bulletproofs.cc | |
parent | bulletproofs: speed up a few multiplies using existing Hi cache (diff) | |
download | monero-c42917624849daeac0b4bc2fb1cd1f2539470b28.tar.xz |
bulletproofs: reject points not in the main subgroup
Diffstat (limited to 'src/ringct/bulletproofs.cc')
-rw-r--r-- | src/ringct/bulletproofs.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ringct/bulletproofs.cc b/src/ringct/bulletproofs.cc index bc7e15f35..7ec87378b 100644 --- a/src/ringct/bulletproofs.cc +++ b/src/ringct/bulletproofs.cc @@ -922,6 +922,19 @@ bool bulletproof_VERIFY(const std::vector<const Bulletproof*> &proofs) for (const Bulletproof *p: proofs) { const Bulletproof &proof = *p; + + // check subgroup + for (const rct::key &k: proof.V) + CHECK_AND_ASSERT_MES(rct::isInMainSubgroup(k), false, "Input point not in subgroup"); + for (const rct::key &k: proof.L) + CHECK_AND_ASSERT_MES(rct::isInMainSubgroup(k), false, "Input point not in subgroup"); + for (const rct::key &k: proof.R) + CHECK_AND_ASSERT_MES(rct::isInMainSubgroup(k), false, "Input point not in subgroup"); + CHECK_AND_ASSERT_MES(rct::isInMainSubgroup(proof.A), false, "Input point not in subgroup"); + CHECK_AND_ASSERT_MES(rct::isInMainSubgroup(proof.S), false, "Input point not in subgroup"); + CHECK_AND_ASSERT_MES(rct::isInMainSubgroup(proof.T1), false, "Input point not in subgroup"); + CHECK_AND_ASSERT_MES(rct::isInMainSubgroup(proof.T2), false, "Input point not in subgroup"); + CHECK_AND_ASSERT_MES(proof.V.size() >= 1, false, "V does not have at least one element"); CHECK_AND_ASSERT_MES(proof.L.size() == proof.R.size(), false, "Mismatched L and R sizes"); CHECK_AND_ASSERT_MES(proof.L.size() > 0, false, "Empty proof"); |