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?