Fix ECDH when scalar and coordinate bit sizes differ

This commit is contained in:
Olivier Chéron 2016-08-28 16:38:04 +02:00
parent 8908af3216
commit 5854b092a8

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