diff --git a/Crypto/PubKey/ECC/Types.hs b/Crypto/PubKey/ECC/Types.hs index 310955b..dbf4957 100644 --- a/Crypto/PubKey/ECC/Types.hs +++ b/Crypto/PubKey/ECC/Types.hs @@ -17,6 +17,7 @@ module Crypto.PubKey.ECC.Types , CurveBinary(..) , CurvePrime(..) , common_curve + , curveSizeBits , ecc_fx , ecc_p , CurveCommon(..) @@ -160,6 +161,10 @@ curvesOIDs = ] -} +-- | get the size of the curve in bits +curveSizeBits :: Curve -> Int +curveSizeBits = numBits . ecc_n . common_curve + -- | Get the curve definition associated with a recommended known curve name. getCurveByName :: CurveName -> Curve getCurveByName SEC_p112r1 = CurveFP $ CurvePrime