The Curve25519 documentation[0] says that we should do these bitwise ops while computing the secret key: mysecret[0] &= 248; mysecret[31] &= 127; mysecret[31] |= 64; It’s not immediately apparent what the reason for this is and if it has any negative/positive impact. Would someone explain it to me? Thanks, Jonathan [0] http://cr.yp.to/ecdh.html