refactor: rename `ctx` param to `ecmult_gen_ctx` where applicable #1911

pull theStack wants to merge 1 commits into bitcoin-core:master from theStack:rename-ctx-to_ecmult_gen_ctx changing 4 files +41 −41
  1. theStack commented at 2:32 PM on August 7, 2026: contributor

    To be more consistent and avoid confusion with regular secp256k1_context instances, rename the ctx parameter to ecmult_gen_ctx in all functions that take secp256k1_ecmult_gen_context pointers (see discussion #1835 (comment) ff.).

    While at it, move the * in pointer declarations of the touched functions to the right side for consistency across the code base, see PR #1252.

  2. theStack added the label tweak/refactor on Aug 7, 2026
  3. in src/ecmult_gen_impl.h:110 in 5c7da62324
     106 | @@ -107,7 +107,7 @@ static void secp256k1_ecmult_gen_gej(const secp256k1_ecmult_gen_context *ctx, se
     107 |       */
     108 |  
     109 |      /* Compute the scalar d = (gn + ctx->scalar_offset). */
     110 | -    secp256k1_scalar_add(&d, &ctx->scalar_offset, gn);
     111 | +    secp256k1_scalar_add(&d, &ecmult_gen_ctx->scalar_offset, gn);
    


    real-or-random commented at 11:10 AM on August 16, 2026:

    The comment should also be changed. (And there are more comments that need to change.)


    theStack commented at 5:00 PM on August 16, 2026:

    Thanks, updated (hope I caught them all).

  4. real-or-random commented at 11:11 AM on August 16, 2026: contributor

    Concept ACK

  5. refactor: rename `ctx` param to `ecmult_gen_ctx` where applicable
    To be more consistent and avoid confusion with regular `_context`
    instances, rename the `ctx` parameter to `ecmult_gen_ctx` in all
    functions that take `_ecmult_gen_context` pointers.
    
    While at it, move the * in pointer declarations of the touched functions
    to the right side for consistency across the code base, see PR #1252.
    81a5a7567d
  6. theStack force-pushed on Aug 16, 2026
  7. real-or-random approved
  8. real-or-random commented at 7:07 PM on August 16, 2026: contributor

    utACK 81a5a7567d10b358e6e41ef6085adf2ab2abc879

  9. real-or-random requested review from Copilot on Aug 17, 2026
  10. ?
    copilot_work_started real-or-random
  11. Copilot commented at 6:29 AM on August 17, 2026: none

    Pull request overview

    Renames generator-multiplication context parameters to distinguish them from full secp256k1_context objects and standardizes pointer spacing.

    Changes:

    • Renames ctx parameters to ecmult_gen_ctx.
    • Updates corresponding references and explanatory comments.
    • Normalizes pointer declaration formatting in touched functions.

    Reviewed changes

    Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

    File Description
    src/ecmult_gen.h Updates internal function declarations.
    src/ecmult_gen_impl.h Renames parameters and references throughout generator multiplication.
    src/ecdsa.h Updates the internal signing declaration.
    src/ecdsa_impl.h Updates the signing implementation.

    💡 <a href="/bitcoin-core/secp256k1/new/master?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/en/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>

  12. real-or-random merged this on Aug 17, 2026
  13. real-or-random closed this on Aug 17, 2026

  14. apoelstra approved
  15. apoelstra commented at 9:11 AM on August 17, 2026: contributor

    ACK 81a5a7567d10b358e6e41ef6085adf2ab2abc879; successfully ran local tests


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-01 14:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me