zkmopro / gpu-acceleration

9 stars 2 forks source link

Implement Optimized Montgomery Multiplication for Metal #6

Open moven0831 opened 1 month ago

moven0831 commented 1 month ago

Problem

Montgomery multiplication is a critical operation in multi-scalar multiplication (MSM) that significantly impacts performance. The current implementation lacks an optimized Montgomery multiplication tailored for Metal, leading to slower field arithmetic operations on iOS devices.

Details

Implement an optimized version of Montgomery multiplication specifically designed for Metal to enhance the efficiency of field operations within the MSM process. This optimization should leverage Metal's capabilities to perform modular arithmetic more efficiently, thereby reducing the overall MSM runtime.

Acceptance criteria

Reference (optional)

moven0831 commented 3 weeks ago

update: the mont_mul backend has been imported from https://github.com/geometryxyz/msl-secp256k1. Noted the source in each imported file. For details please check development branch