Switched ecc library to https://github.com/jpillora/eccjs - easier to understand, simpler,  and seems better maintained. I've read through all the code and it seems correct