From 1a954ad96e34d47833094a2d6b1384be1a35087c Mon Sep 17 00:00:00 2001 From: Ravin Perera <33562092+ravinsp@users.noreply.github.com> Date: Tue, 22 Dec 2020 16:55:44 +0530 Subject: [PATCH] Implemented output signature checks. (#200) --- CMakeLists.txt | 1 + examples/js_client/browser-example.html | 61 ++++-- examples/js_client/hp-client-lib.js | 263 +++++++++++++++++++----- examples/js_client/package-lock.json | 5 + examples/js_client/package.json | 1 + examples/js_client/text-client.js | 74 +++++-- src/consensus.cpp | 163 +++++++++------ src/consensus.hpp | 24 ++- src/msg/bson/usrmsg_bson.cpp | 47 ++++- src/msg/bson/usrmsg_bson.hpp | 7 +- src/msg/fbuf/ledger_helpers.cpp | 4 +- src/msg/fbuf/ledger_schema.fbs | 2 +- src/msg/fbuf/ledger_schema_generated.h | 31 +-- src/msg/fbuf/p2pmsg_content.fbs | 5 +- src/msg/fbuf/p2pmsg_content_generated.h | 108 +++++++--- src/msg/fbuf/p2pmsg_helpers.cpp | 19 +- src/msg/json/usrmsg_json.cpp | 114 +++++++--- src/msg/json/usrmsg_json.hpp | 7 +- src/msg/usrmsg_common.hpp | 4 + src/msg/usrmsg_parser.cpp | 8 +- src/msg/usrmsg_parser.hpp | 5 +- src/p2p/p2p.hpp | 5 +- src/util/merkle_hash_tree.cpp | 157 ++++++++++++++ src/util/merkle_hash_tree.hpp | 34 +++ src/util/util.cpp | 17 +- src/util/util.hpp | 2 + 26 files changed, 903 insertions(+), 265 deletions(-) create mode 100644 src/util/merkle_hash_tree.cpp create mode 100644 src/util/merkle_hash_tree.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ec9c2884..13910348 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ add_executable(hpcore src/util/rollover_hashset.cpp src/util/ttl_set.cpp src/util/buffer_store.cpp + src/util/merkle_hash_tree.cpp src/unl.cpp src/crypto.cpp src/conf.cpp diff --git a/examples/js_client/browser-example.html b/examples/js_client/browser-example.html index 4af813c0..67921773 100644 --- a/examples/js_client/browser-example.html +++ b/examples/js_client/browser-example.html @@ -1,7 +1,8 @@
-