- h2b, b2h (rctTypes) and sumKeys (rctOps): from the original RingCT
import (9b1afe5f2, 2016-05-13); never referenced by any caller since
the import.
- cn_fast_hash128, hash_to_scalar128 (rctOps): from the same import.
hash_to_scalar128 (and cn_fast_hash128 through it) was last used by
the original MLSAG gen/ver hashing, which dbb5f2d6a (2016-07-09)
replaced with keyV-based hash_to_scalar; dead since then.
- bos_coster_heap_conv (multiexp): added in 9ff6e6a0a (2018-01-09)
alongside bos_coster_heap_conv_robust; multiexp() only ever
dispatched the robust variant, so the non-robust one was never
called. The robust variant is kept, as tests/performance_tests
still uses it (production dispatch moved to Straus/Pippenger in
939bc22/263431c).
One theoretically could have crafted a "long amount" (pre-v10) RingCT transaction
with non-0 padding bytes in the decoded amount which fails receiver scanning, but
passes third-party wallet proof checking.
`libringct` was linking against `libcryptonote_basic` for a single, one-line convenience function: `cryptonote::get_blob_hash`.
Since `cryptonote_basic.h` includes `rctTypes.h`, this one function effectively made an explicit circular dependency between
the two libraries. `cryptonote_format_utils.cpp` was including header `rctSigs.h` from `libringct`, when only `rctOps.h` from
`libringct_basic` needed to be included. `libcryptonote_basic` wasn't explictly linking against `libringct_basic` nor
`libringct` like it should have. And `libblockchain_db` wasn't linking against `libcryptonote_basic` like it should have. We
can also downgrade `libblockchain_db`'s dependency on `libringct` to `libringct_basic`.
There is currently no compiler protection when someone tries to
do (for example) `BLOB_SERIALIZER(std::vector<int>)`. You just
get runtime allocation errors. This has already eaten up dev time
before, so this PR adds a static assertion that the type must be
trivially copyable, as defined by the C++ standard. Types can
override this if applicable if they use `BLOB_SERIALIZER_FORCED`.
It avoids dividing by 8 when deserializing a tx, which is a slow
operation, and multiplies by 8 when verifying and extracing the
amount, which is much faster as well as less frequent