The API for p256k1 is modeled after curve25519_dalek, since that allows easy porting between the two curve libraries. But there is one discrepancy: curve25519_dalek does not implement From<CompressedRistretto> for RistrettoPoint, since CompressedRistretto does not do any validation of the bytes it is constructed with, and not all byte arrays are valid points on the curve.
Remove From<Compressed> for Point and replace it with TryFrom<Compressed> for Point instead, returning errors when they arise.
The API for
p256k1
is modeled aftercurve25519_dalek
, since that allows easy porting between the two curve libraries. But there is one discrepancy:curve25519_dalek
does not implementFrom<CompressedRistretto> for RistrettoPoint
, sinceCompressedRistretto
does not do any validation of the bytes it is constructed with, and not all byte arrays are valid points on the curve.Remove
From<Compressed> for Point
and replace it withTryFrom<Compressed> for Point
instead, returning errors when they arise.