Follow scalar multiplication bit by bit and agree on a secret point with ECDH. Compare RTL and LTR algorithms with integers up to 2048 bits.
Educational implementation: rand() generates toy secrets. No authentication, KDF, subgroup-order verification or constant-time execution. K is a point, not an encryption-ready key.