trezor / trezor-crypto

:lock: Don't use this repo, use the new monorepo instead:
https://github.com/trezor/trezor-firmware
MIT License
501 stars 201 forks source link

ed25519: double scalarmult fix - return full point #172

Closed ph4r05 closed 6 years ago

ph4r05 commented 6 years ago

Double scalar multiplication returns fully valid ED point (Just one more multiplication).

If you prefer not to add multiplication there is another alternative - a bit more difficult IMO. We would have to generalize scalarmult method to return ge25519_p1p1 point so we can make it both partial and full points. There would be then scalarmult method which is a simple wrapper for scalarmult returning ge25519_p1p1 and making a partial point from it.

I personally like the proposed idea more because it is backward compatible change with small overhead, is consistent with scalarmult base and does not make API more complex.

ph4r05 commented 6 years ago

Similar to https://github.com/trezor/trezor-crypto/pull/171

onvej-sl commented 6 years ago

ACK

prusnak commented 6 years ago

Thx!