I'm implementing point addition, doubling and scalar multiplication using projective coordinates. I took reference from this link.
I have implemented
- Routine 2.2.6 (ec_double)
- Routine 2.2.7 (ec_add)
- Routine 2.2.8 (ec_full_add)
- Routine 2.2.9 (ecc_full_sub)
They all are working and I have verified the results with the example results given at the last for P-256 curve.
I implemented Routine 2.2.10 ec_mul t(Scalar multiplication) But I couldnt get the correct output. In line 15 and 16 of this routine they take the binary representation of $d$ (random number) and $3d$. And the loop skips both MSB and LSB and performs the operations.
I got doubts like that $3d$ is modular multiplication or simple multiplication?. The loops runs for $d$ or $3d$ if its not modular multiplication?
Is there anything else I'm missing out?. If somebody has followed this algorithm and implemented it please help me out here.