diff --git a/Crypto/PubKey/ECC/Types.hs b/Crypto/PubKey/ECC/Types.hs index 4f100f9..57ea9a9 100644 --- a/Crypto/PubKey/ECC/Types.hs +++ b/Crypto/PubKey/ECC/Types.hs @@ -164,7 +164,8 @@ curvesOIDs = -- | get the size of the curve in bits curveSizeBits :: Curve -> Int -curveSizeBits = numBits . ecc_n . common_curve +curveSizeBits (CurveFP c) = numBits (ecc_p c) +curveSizeBits (CurveF2m c) = numBits (ecc_fx c) - 1 -- | Get the curve definition associated with a recommended known curve name. getCurveByName :: CurveName -> Curve