There are a couple of places where modexp is used, but the other operations aren't modulo N. These places could be optimised by making them (mod N). That ought to be mathematically equivalent, and it is for multiplication.
As it turns out however, the test_srp program breaks when changing the subtraction B-k.g^x because this subtraction can yield a negative outcome which appears to be treated differently by the subsequent modexp operation. Might be a library issue, that supports a wider range of mathematics that we should avoid.
This optimisation has not been committed to the main branch yet, as it requires more work.
There are a couple of places where modexp is used, but the other operations aren't modulo N. These places could be optimised by making them (mod N). That ought to be mathematically equivalent, and it is for multiplication.
As it turns out however, the test_srp program breaks when changing the subtraction B-k.g^x because this subtraction can yield a negative outcome which appears to be treated differently by the subsequent modexp operation. Might be a library issue, that supports a wider range of mathematics that we should avoid.
This optimisation has not been committed to the main branch yet, as it requires more work.