bulletproofs: reject points not in the main subgroup

This commit is contained in:
moneromooo-monero 2018-06-29 15:03:00 +01:00
parent 1569717718
commit c429176248
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
6 changed files with 97 additions and 0 deletions

View file

@ -51,6 +51,7 @@ enum test_op
op_addKeys2,
op_addKeys3,
op_addKeys3_2,
op_isInMainSubgroup,
};
template<test_op op>
@ -102,6 +103,7 @@ public:
case op_addKeys2: rct::addKeys2(key, scalar0, scalar1, point0); break;
case op_addKeys3: rct::addKeys3(key, scalar0, point0, scalar1, precomp1); break;
case op_addKeys3_2: rct::addKeys3(key, scalar0, precomp0, scalar1, precomp1); break;
case op_isInMainSubgroup: rct::isInMainSubgroup(point0); break;
default: return false;
}
return true;

View file

@ -237,6 +237,7 @@ int main(int argc, char** argv)
TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_addKeys2);
TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_addKeys3);
TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_addKeys3_2);
TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_isInMainSubgroup);
TEST_PERFORMANCE2(filter, p, test_multiexp, multiexp_bos_coster, 2);
TEST_PERFORMANCE2(filter, p, test_multiexp, multiexp_bos_coster, 4);