Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Point Coordinate Conversion and Scalar Decomposition in Metal MSM Implementation #33

Open
moven0831 opened this issue Jan 7, 2025 · 0 comments
Assignees

Comments

@moven0831
Copy link
Collaborator

Related issue

Problem

The current implementation of point coordinate conversion and scalar decomposition in the Metal version of the MSM algorithm can be further optimized to improve performance and memory usage.

Details

  1. Convert elliptic curve points from Jacobian coordinates to Montgomery form using Barrett Reduction. This conversion enables more efficient arithmetic operations in the subsequent stages of the MSM algorithm.

  2. Decompose scalars into chunks using the signed bucket index technique. This method reduces the number of buckets by half, enhancing parallel processing efficiency and balancing the workload across Metal's GPU threads.

  3. Optimize memory access patterns and buffer handling in the Metal shaders to minimize data transfer overhead and maximize GPU utilization.

Acceptance Criteria

  • Implement a Metal shader function to convert Jacobian coordinates to Montgomery form using Barrett Reduction.
  • Modify the scalar decomposition logic in the Metal shader to use the signed bucket index technique, decomposing scalars into chunks with signed indices.
  • Validate the correctness of the point coordinate conversion and scalar decomposition through comprehensive testing with various input sizes and distributions.

References

@moven0831 moven0831 self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant