From 9845734b2b2e2747c7687d5e4585ba228b200c7d Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 5 Dec 2016 13:34:54 +0900 Subject: [PATCH] fixing P256 endian. --- Crypto/PubKey/ECC/P256.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Crypto/PubKey/ECC/P256.hs b/Crypto/PubKey/ECC/P256.hs index 99ecbcc..e5a6e1d 100644 --- a/Crypto/PubKey/ECC/P256.hs +++ b/Crypto/PubKey/ECC/P256.hs @@ -49,7 +49,7 @@ import Crypto.Internal.Compat import Crypto.Internal.Imports import Crypto.Internal.ByteArray import qualified Crypto.Internal.ByteArray as B -import Data.Memory.PtrMethods (memSet, memCopy) +import Data.Memory.PtrMethods (memSet) import Crypto.Error import Crypto.Random import Crypto.Number.Serialize.Internal (os2ip, i2ospOf) @@ -119,7 +119,7 @@ pointDh scalar p = B.unsafeCreate scalarSize $ \dst -> withTempPoint $ \dx dy -> do withScalar scalar $ \n -> withPoint p $ \px py -> withScalarZero $ \nzero -> ccryptonite_p256_points_mul_vartime nzero n px py dx dy - memCopy dst (castPtr dx) scalarSize + ccryptonite_p256_to_bin (castPtr dx) dst -- | multiply the point @p with @n2 and add a lifted to curve value @n1 --