A portable implementation of CurveCP