privacy-scaling-explorations / zk-kit

A monorepo of reusable libraries for zero-knowledge technologies.
https://zkkit.pse.dev
MIT License
291 stars 79 forks source link

`mulPointScalar` vulnerable to timing attacks #324

Open ChinoCribioli opened 2 months ago

ChinoCribioli commented 2 months ago

The mulPointScalar method is implemented with the regular 'square and multiply' algorithm, which is prone to timing attacks due to the fact that the number of EC point additions depends on the number of 1's in the binary expression of the scalar. To fix this it is necessary to implement an algorithm to multiply a point by an integer in constant time.