MONTGOMERY_NOTES.md raw

Montgomery Multiplication Implementation Notes

Status

Montgomery multiplication has been partially implemented in field.go. The current implementation provides the API structure but uses standard multiplication internally.

Current Implementation

Issues

  1. The FromMontgomery() implementation needs proper R⁻¹ computation
  2. The MontgomeryMul() should use the REDC algorithm directly instead of standard multiplication
  3. The R² constant may need verification
  4. Tests are currently failing due to incomplete implementation

Next Steps

  1. Compute R⁻¹ mod p correctly
  2. Implement proper REDC algorithm in MontgomeryMul
  3. Verify R² constant against reference implementation
  4. Add comprehensive tests

References