Skip to content

Conversation

@jonasnick
Copy link
Contributor

This is a draft because I'm not sure about the cleanest way to implement it.

@real-or-random
Copy link
Contributor

This is a draft because I'm not sure about the cleanest way to implement it.

The current approach looks clean. What other approaches do you have in mind?

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my x86_64 system, this PR reduces the memory allocated on the scratch space from 2224 bytes to 1452 bytes per point.

Please ping me once it’s undrafted.

@jonasnick
Copy link
Contributor Author

The current approach requires a temporary array int wnaf_tmp[256]; to provide to secp256k1_ecmult_wnaf which looks unclean. The alternatives are

  1. copy almost all of secp256k1_ecmult_wnaf into secp256k1_ecmult_wnaf_small, or
  2. remove secp256k1_ecmult_wnaf_small and write an secp256k1_ecmult macro.

Both options seem to be worse.

@hebasto
Copy link
Member

hebasto commented Oct 27, 2025

The current approach requires a temporary array int wnaf_tmp[256]; to provide to secp256k1_ecmult_wnaf which looks unclean. The alternatives are

  1. copy almost all of secp256k1_ecmult_wnaf into secp256k1_ecmult_wnaf_small, or

  2. remove secp256k1_ecmult_wnaf_small and write an secp256k1_ecmult macro.

Both options seem to be worse.

I might suggest a third option: hebasto@5c0d6ee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants