diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2021-01-06 20:53:21 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2021-01-06 20:53:21 +0100 |
commit | 0de650726174d7432df89cb648d01c76f36a340f (patch) | |
tree | 311da1e51df855a2c527895c4aeaae5b482d0a92 /src/Pairing.hs | |
parent | 796c31765a576b8b24acebd32f0797c1a64f3667 (diff) |
Pairing: use big endian for the confirmation number
Diffstat (limited to 'src/Pairing.hs')
-rw-r--r-- | src/Pairing.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |