I would like to transpose the Ed25519 ref10 implementation to a similar twisted Edwards curve that is based on another prime, in order to have the same speed optimizations in place for the new curve. Most of the code is not too hard to understand.
However, I don't understand what is going on in the function 'fe_mul', where there are several multiplications by constant factors like 19 and 38.
Can somebody please give me a hint where these constants are coming from? Many thanks!