Skip to content

Commit

Permalink
Add TODO's for fcmp's
Browse files Browse the repository at this point in the history
  • Loading branch information
j-berman committed Feb 22, 2024
1 parent 46c5801 commit 6602377
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
7 changes: 6 additions & 1 deletion src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GeneratorsAndTree>;
fn add_squashed_enote_to_tree(state: &mut Box<GeneratorsAndTree>, squashed_enote: &[u8]);
fn make_blind(generators_and_tree: &mut Box<GeneratorsAndTree>) -> [u8; 32];
// TODO: use consistent type for blind
// TODO: pass blinded point in to prove
fn prove(generators_and_tree: &Box<GeneratorsAndTree>, blind: &[u8], squashed_enote: &[u8]) -> Box<BlindedPointAndProof>;
fn verify(generators_and_tree: &Box<GeneratorsAndTree>, proof_res: &Box<BlindedPointAndProof>) -> bool;
}
Expand All @@ -34,6 +35,10 @@ pub struct BlindedPointAndProof {
}

pub fn init() -> Box<GeneratorsAndTree> {
// 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()))
}

Expand Down
3 changes: 3 additions & 0 deletions src/seraphis_main/tx_component_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<monero_rust::curve_trees::BlindedPointAndProof> blinded_point_and_proof;
};
inline const boost::string_ref container_name(const SpMembershipProofV2&) { return "SpMembershipProofV2"; }
Expand Down

0 comments on commit 6602377

Please sign in to comment.