From 0de650726174d7432df89cb648d01c76f36a340f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 6 Jan 2021 20:53:21 +0100 Subject: Pairing: use big endian for the confirmation number --- src/Pairing.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Pairing.hs') diff --git a/src/Pairing.hs b/src/Pairing.hs index 460dd55..ce176a6 100644 --- a/src/Pairing.hs +++ b/src/Pairing.hs @@ -148,7 +148,7 @@ nonceDigest id1 id2 nonce1 nonce2 = hashToRefDigest $ serializeObject $ Rec confirmationNumber :: RefDigest -> String confirmationNumber dgst = let (a:b:c:d:_) = map fromIntegral $ BA.unpack dgst :: [Word32] - str = show $ (a .|. (b `shift` 8) .|. (c `shift` 16) .|. (d `shift` 24)) `mod` (10 ^ len) + str = show $ ((a `shift` 24) .|. (b `shift` 16) .|. (c `shift` 8) .|. d) `mod` (10 ^ len) in replicate (len - length str) '0' ++ str where len = 6 -- cgit v1.2.3