tgalal / python-axolotl-curve25519

GNU General Public License v3.0
35 stars 28 forks source link

Bitwise operations on secret key #11

Closed gjedeer closed 6 years ago

gjedeer commented 7 years ago

I'm wondering what's the reason why there are bit-wise operations on the secret key in generatePrivateKey():

https://github.com/tgalal/python-axolotl-curve25519/blame/e4a9c4de0eae27223200579c58d1f8f6d20637e2/curve25519module.c#L98

I've been trying to find something similar in the reference 25519 implementation by Bernstein and I could not. Care to point me in the right direction?

Vinc0682 commented 6 years ago

These operations are specified on Bernstein's official homepage: https://cr.yp.to/ecdh.html

gjedeer commented 6 years ago

I see, he just used a precomputed secret key that's why these operations were already performed. Thanks @Vinc0682