Merge pull request #101 from ocheron/ecc-bitsize-fixes

Fix ECDH/ECDSA when scalar and coordinate bit sizes differ
This commit is contained in:
Vincent Hanquez 2016-09-15 20:18:15 +01:00 committed by GitHub
commit 32e77e6f66

View File

@ -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