Skip to content

[Code/Doc Hygiene] TOB-RIPCTXR Appendix C roundup (typos, dead reimpl, doc mismatches) #116

@tesseract-ripple

Description

@tesseract-ripple

Severity: Informational; trivial fixes.
Source: TOB May 2026 revision, Appendix C — "Non-Security-Related
Recommendations" (pp. 56-58). mpt-crypto-side items only;
C.1 (XLS-0096 README terminology sort) and C.2 (XLS-0096 README
typos) belong in XRPLF/XRPL-Standards, not this repo. C.3
(canonical encrypted zero counter retry) is tracked separately in
#108.

This issue bundles the five remaining mpt-crypto items from
Appendix C into one cleanup PR.

Items

  1. C.4 — Extraneous z^2 in BP verifier comment.
    src/bulletproof_aggregated.c around L2629-L2630 (current line
    may differ post-MSM-refactor; locate by string). The comment
    reads:

    /* P += sum_{k=0}^{n-1} [ (-z)*G_k + ( z*y^k + z^(block+2)*z^2*2^i ) *
     *   (y^{-k}*H_k) ] */
    

    The intended exponent is z^(block+2)*2^i, without the extra
    z^2 factor.

  2. C.5 — secp256k1_mpt_pedersen_commit reimplements
    mpt_uint64_to_scalar.
    src/commitments.c#L226-L231 does the
    uint64 → 32-byte BE scalar conversion manually instead of
    calling the shared helper at mpt_internal.h#L60-L67.

  3. C.6 — Documentation typo. mpt_utility.h#L425 reads
    "Helper function to substract a transparent amount from a
    hidden commitment." Replace "substract" with "subtract".

  4. C.7 — Documentation / implementation size mismatch.
    include/utility/mpt_utility.h#L44-L54:
    mpt_pedersen_proof_params documents pedersen_commitment as
    "64-byte" but the array dimension is kMPT_PEDERSEN_COMMIT_SIZE,
    which is 33. Update the comment to "33-byte (SEC1-compressed)".

  5. C.8 — Stale parameter doc.
    include/utility/mpt_utility.h#L456-L472:
    mpt_verify_send_range_proof's doxygen lists a @param ctx
    that is not in the function signature. Either remove the
    @param ctx line or pass ctx through.

Acceptance

  • All five fixes land in one PR.
  • Pre-commit + clang-format clean.
  • 11/11 ctest still green; no behavior change.

References

  • TOB May 2026 Appendix C, pp. 57-58 (Figures C.5 through C.10).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions