What changed, and why it matters
This commit adds a new internal helper function in Monero's experimental FCMP++ (Forward-Commitment Membership Proof) code. It converts transaction output data into an intermediate mathematical representation called a 'pre-leaf tuple' by computing derivatives of elliptic-curve points. There is no user-facing change, no bug fix, and no security-relevant behavior described in the commit or diff.
No security action required. Treat as routine feature/refactoring work in the FCMP++ implementation.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces PreLeafTuple, output_tuple_to_pre_leaf_tuple, and output_to_pre_leaf_tuple in src/fcmp_pp/curve_trees.cpp. These are static/internal helpers that take an OutputTuple (O, I, C curve points) and call point_to_ed_derivatives for each point, throwing std::runtime_error on failure. The code is purely additive, adds no network or consensus logic, and does not modify existing cryptographic checks.
Changed components
src/fcmp_pp/curve_trees.cppInspect captured patch +49 / −0
diff --git a/src/fcmp_pp/curve_trees.cpp b/src/fcmp_pp/curve_trees.cpp
index a533390..49650cd 100644
--- a/src/fcmp_pp/curve_trees.cpp
+++ b/src/fcmp_pp/curve_trees.cpp
@@ -33,6 +33,16 @@
#include "fcmp_pp_types.h"
#include "profile_tools.h"
+namespace
+{
+ // Struct composed of ec elems needed to get a full-fledged leaf tuple
+ struct PreLeafTuple final
+ {
+ fcmp_pp::EdDerivatives O_derivatives;
+ fcmp_pp::EdDerivatives I_derivatives;
+ fcmp_pp::EdDerivatives C_derivatives;
+ };
+}
namespace fcmp_pp
{
@@ -40,6 +50,8 @@ namespace curve_trees
{
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
+// Public helper functions
+//----------------------------------------------------------------------------------------------------------------------
OutputTuple output_to_tuple(const OutputPair &output_pair)
{
const crypto::public_key &output_pubkey = output_pubkey_cref(output_pair);
@@ -105,5 +117,42 @@ OutputTuple output_to_tuple(const OutputPair &output_pair)
}
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
+// Static functions
+//----------------------------------------------------------------------------------------------------------------------
+static PreLeafTuple output_tuple_to_pre_leaf_tuple(const OutputTuple &o)
+{
+ TIME_MEASURE_NS_START(point_to_ed_derivatives_ns);
+
+ const crypto::ec_point &O = (crypto::ec_point&) o.O;
+ const crypto::ec_point &I = (crypto::ec_point&) o.I;
+ const crypto::ec_point &C = (crypto::ec_point&) o.C;
+
+ /*
+ TODO: investigate perf impact of the following extraneous ops:
+ - Decompressing O and C when checking points for torsion and again here.
+ - Compressing I in derive_key_image_generator and decompressing again here.
+ */
+ PreLeafTuple plt;
+ if (!fcmp_pp::point_to_ed_derivatives(O, plt.O_derivatives))
+ throw std::runtime_error("failed to get ed derivatives from O");
+ if (!fcmp_pp::point_to_ed_derivatives(I, plt.I_derivatives))
+ throw std::runtime_error("failed to get ed derivatives from I");
+ if (!fcmp_pp::point_to_ed_derivatives(C, plt.C_derivatives))
+ throw std::runtime_error("failed to get ed derivatives from C");
+
+ TIME_MEASURE_NS_FINISH(point_to_ed_derivatives_ns);
+
+ LOG_PRINT_L3("point_to_ed_derivatives_ns: " << point_to_ed_derivatives_ns);
+
+ return plt;
+}
+//----------------------------------------------------------------------------------------------------------------------
+static PreLeafTuple output_to_pre_leaf_tuple(const OutputPair &output_pair)
+{
+ const auto o = output_to_tuple(output_pair);
+ return output_tuple_to_pre_leaf_tuple(o);
+}
+//----------------------------------------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------------
} //namespace curve_trees
} //namespace fcmp_pp
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.