zkmopro / gpu-acceleration

7 stars 1 forks source link

Implement Barrett Reduction Techniques in Metal #7

Open moven0831 opened 1 week ago

moven0831 commented 1 week ago

Problem

Efficient modular reduction is essential for converting point coordinates into Montgomery form. The current implementation does not use the Montgomery form in Metal, resulting in unnecessary computational overhead.

Details

Integrate efficient Barrett reduction methods within Metal shaders to facilitate the conversion of point coordinates into Montgomery form. Evaluate both "vanilla" Barrett reduction and Barrett-Domb reduction to determine the most performant approach on iOS devices.

Acceptance criteria

Reference