herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
452 stars 153 forks source link

Do not mark EcT coordinates mutable #4

Closed arybczak closed 7 years ago

arybczak commented 7 years ago

Current situation may result in a silent corruption in multi-threaded environment. If two threads hold a (seemingly) const reference to a point and e.g. the first thread calls arithmetic operation where the point is one of the operands whereas the second thread calls normalize on the point and these calls are interleaved, the first thread might produce invalid result.

herumi commented 7 years ago

Thank you for important suggestion. I dit not notice the problem. I should remove normalize() method.

herumi commented 7 years ago

I fixed them.

arybczak commented 7 years ago

Thanks!