Montgomery’s trick is a method for inverting a batch of field elements efficiently by using accumulated products and the extended Euclidean algorithm.
The trick involves computing accumulated products up to each element, then calculating the field inversion for the final product, and using it to calculate the inversion of each element in the batch.
This optimization reduces the number of expensive field inversions from one per element to just one overall, resulting in a computationally lighter solution.
The application of Montgomery’s trick is beneficial for batch inversion in finite fields, especially in cryptography applications where field operations are common.