[ECC] add curveSizeBits
This commit is contained in:
parent
495788dded
commit
9a1f06e3e8
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user