ecc: fix Montgomery curve bugs.