LLFourn / secp256kfun

A pure-rust secp256k1 library optimised for fun
BSD Zero Clause License
104 stars 29 forks source link

Test Check multiplying by infinity returns infinity #13

Closed LLFourn closed 4 years ago

LLFourn commented 4 years ago

see: https://github.com/bitcoin-core/secp256k1/pull/791/files

elichai commented 4 years ago

Note, that generally the high level API of libsecp256k1 Doesn't support points at infinity, because those aren't valid public keys and don't have any meaningful serialization

LLFourn commented 4 years ago

This is about the Low level API (ecmult and ecmult_const). It turns out that I was allowing infinity to be passed down to these and then panicking.

The solution is just to check for that and early exit. This is what gmax was suggesting here https://github.com/bitcoin-core/secp256k1/pull/791 (I followed up suggesting it should be applied to ecmult as well).