From 6602377e05c134d2b96236663112477a799d62e6 Mon Sep 17 00:00:00 2001 From: j-berman Date: Wed, 21 Feb 2024 19:18:01 -0800 Subject: [PATCH] Add TODO's for fcmp's --- CMakeLists.txt | 12 ++++++++++++ src/rust/src/lib.rs | 7 ++++++- src/seraphis_main/tx_component_types.h | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6b5dc57a54..ef61a5a531f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -373,6 +373,18 @@ if(NOT MANUAL_SUBMODULES) check_submodule(external/randomx) check_submodule(external/supercop) check_submodule(external/mx25519) + + # TODO: remove check_submodule_commit + function (check_submodule_commit relative_path commit) + execute_process(COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${relative_path} OUTPUT_VARIABLE localHead) + string(COMPARE EQUAL "${localHead}" "${commit}\n" upToDate) + if (upToDate) + message(STATUS "Submodule '${relative_path}' is up-to-date") + else() + message(FATAL_ERROR "Submodule '${relative_path}' is not up-to-date. Please update all submodules with\ngit submodule update --init --force\nor run cmake with -DMANUAL_SUBMODULES=1\n") + endif() + endfunction () + check_submodule_commit(external/full-chain-membership-proofs 40ebc979c54f3007740e42764301d18c0d561125) endif() endif() diff --git a/src/rust/src/lib.rs b/src/rust/src/lib.rs index fa6617152c5..f50ecf978f3 100644 --- a/src/rust/src/lib.rs +++ b/src/rust/src/lib.rs @@ -15,12 +15,13 @@ mod ffi { #[namespace = "monero_rust::curve_trees"] extern "Rust" { type GeneratorsAndTree; + // TODO: don't pass blinded point back type BlindedPointAndProof; fn init() -> Box; fn add_squashed_enote_to_tree(state: &mut Box, squashed_enote: &[u8]); fn make_blind(generators_and_tree: &mut Box) -> [u8; 32]; - // TODO: use consistent type for blind + // TODO: pass blinded point in to prove fn prove(generators_and_tree: &Box, blind: &[u8], squashed_enote: &[u8]) -> Box; fn verify(generators_and_tree: &Box, proof_res: &Box) -> bool; } @@ -34,6 +35,10 @@ pub struct BlindedPointAndProof { } pub fn init() -> Box { + // TODO: share C1 H generator with Seraphis (required) + // TODO: use constant generators, don't randomly generate each init (required) + // TODO: share bulletproof generators with Seraphis (perf optimization) + // TODO: share C1 G generator with Seraphis (cleanliness) Box::new(GeneratorsAndTree(ed25519_init())) } diff --git a/src/seraphis_main/tx_component_types.h b/src/seraphis_main/tx_component_types.h index e2a730dd5b3..1d8e820f048 100644 --- a/src/seraphis_main/tx_component_types.h +++ b/src/seraphis_main/tx_component_types.h @@ -168,6 +168,9 @@ std::size_t sp_membership_proof_v1_size_bytes_compact(const SpMembershipProofV1 struct SpMembershipProofV2 final { // TODO: use cleaner types + // TODO: the blinded point should be equal to SpMembershipProofV1 image_offset. + // It should be recalculated on verification (Q" = K" + C") and shouldn't + // be included along with the membership proof rust::Box blinded_point_and_proof; }; inline const boost::string_ref container_name(const SpMembershipProofV2&) { return "SpMembershipProofV2"; }