Fix ECDH when scalar and coordinate bit sizes differ
This commit is contained in:
parent
8908af3216
commit
5854b092a8
@ -164,7 +164,8 @@ curvesOIDs =
|
|||||||
|
|
||||||
-- | get the size of the curve in bits
|
-- | get the size of the curve in bits
|
||||||
curveSizeBits :: Curve -> Int
|
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.
|
-- | Get the curve definition associated with a recommended known curve name.
|
||||||
getCurveByName :: CurveName -> Curve
|
getCurveByName :: CurveName -> Curve
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user