# Does ECC's cofactor affects ECC's private key selection?

I am doing a project using ECDH with Curve25519. I use mbedtls library, in the implement, I realize that the private key of Curve25519 is clear 3 last bit, or it is divide by 8 and the cofactor of Curve25519 is 8 too. I looked to another curve (Curve448) it cofactor is 4 and the private key is divide by 4 too. I tried choosing a non-divisible key for 8 and the algorithm still works. So does cofactor affects private key on ECC.

• Does ECC's cofactor affects ECC's private key selection?
• If I intentionally choose a key that is not divisible by 8, is there a problem?
• – kelalaka Jan 1 at 13:05

If someone sends you a small order point (let's say $$4$$), then by getting rid of the least significant bits of your private key, the result of the algorithm will give $$0$$ which is consider invalid and the small order point will be automatically detected.