From aec6af5de40f39acbac48b427fce28a9e25465fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Ch=C3=A9ron?= Date: Tue, 4 Jul 2017 21:39:01 +0200 Subject: [PATCH] Add note about P256 encoding of point-at-infinity --- Crypto/PubKey/ECC/P256.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Crypto/PubKey/ECC/P256.hs b/Crypto/PubKey/ECC/P256.hs index ba9ac60..1409c91 100644 --- a/Crypto/PubKey/ECC/P256.hs +++ b/Crypto/PubKey/ECC/P256.hs @@ -114,7 +114,8 @@ pointMul scalar p = withNewPoint $ \dx dy -> withScalar scalar $ \n -> withPoint p $ \px py -> withScalarZero $ \nzero -> ccryptonite_p256_points_mul_vartime nzero n px py dx dy --- | Similar to 'pointMul', serializing the x coordinate as binary +-- | Similar to 'pointMul', serializing the x coordinate as binary. +-- When scalar is multiple of point order the result is all zero. pointDh :: ByteArray binary => Scalar -> Point -> binary pointDh scalar p = B.unsafeCreate scalarSize $ \dst -> withTempPoint $ \dx dy -> do