mirror of
https://github.com/monero-project/monero
synced 2025-10-06 16:52:41 +02:00
ringct & cryptonote_basic: detangle dependencies
`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`.
This commit is contained in:
@@ -45,7 +45,8 @@ target_link_libraries(blockchain_db
|
||||
PUBLIC
|
||||
common
|
||||
cncrypto
|
||||
ringct
|
||||
cryptonote_basic
|
||||
ringct_basic
|
||||
${LMDB_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
|
@@ -71,6 +71,7 @@ target_link_libraries(cryptonote_basic
|
||||
checkpoints
|
||||
cryptonote_format_utils_basic
|
||||
device
|
||||
ringct_basic
|
||||
${Boost_DATE_TIME_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_SERIALIZATION_LIBRARY}
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#include "cryptonote_config.h"
|
||||
#include "crypto/crypto.h"
|
||||
#include "crypto/hash.h"
|
||||
#include "ringct/rctSigs.h"
|
||||
#include "ringct/rctOps.h"
|
||||
|
||||
using namespace epee;
|
||||
|
||||
|
@@ -69,7 +69,6 @@ target_link_libraries(ringct
|
||||
PUBLIC
|
||||
common
|
||||
cncrypto
|
||||
cryptonote_basic
|
||||
device
|
||||
PRIVATE
|
||||
${OPENSSL_LIBRARIES}
|
||||
|
@@ -28,16 +28,18 @@
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "rctSigs.h"
|
||||
|
||||
#include "misc_log_ex.h"
|
||||
#include "misc_language.h"
|
||||
#include "common/perf_timer.h"
|
||||
#include "common/threadpool.h"
|
||||
#include "common/util.h"
|
||||
#include "rctSigs.h"
|
||||
#include "bulletproofs.h"
|
||||
#include "bulletproofs_plus.h"
|
||||
#include "cryptonote_basic/cryptonote_format_utils.h"
|
||||
#include "cryptonote_config.h"
|
||||
#include "device/device.hpp"
|
||||
#include "serialization/crypto.h"
|
||||
|
||||
using namespace crypto;
|
||||
using namespace std;
|
||||
@@ -612,7 +614,8 @@ namespace rct {
|
||||
key prehash;
|
||||
CHECK_AND_ASSERT_THROW_MES(const_cast<rctSig&>(rv).serialize_rctsig_base(ba, inputs, outputs),
|
||||
"Failed to serialize rctSigBase");
|
||||
cryptonote::get_blob_hash(ss.str(), h);
|
||||
const std::string sig_base_blob = ss.str();
|
||||
cn_fast_hash(sig_base_blob.data(), sig_base_blob.size(), h);
|
||||
hashes.push_back(hash2rct(h));
|
||||
|
||||
keyV kv;
|
||||
|
Reference in New Issue
Block a user