ringct: remove an unnecessary scalarmultBase in zeroCommit

This commit is contained in:
moneromooo-monero 2018-06-06 10:05:14 +01:00
parent 8a7b3ff138
commit 01cc978722
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 12 additions and 4 deletions

View file

@ -1061,3 +1061,13 @@ TEST(ringct, key_ostream)
out.str()
);
}
TEST(ringct, zeroCommmit)
{
static const uint64_t amount = crypto::rand<uint64_t>();
const rct::key z = rct::zeroCommit(amount);
const rct::key a = rct::scalarmultBase(rct::identity());
const rct::key b = rct::scalarmultH(rct::d2h(amount));
const rct::key manual = rct::addKeys(a, b);
ASSERT_EQ(z, manual);
}