summaryrefslogtreecommitdiff
path: root/src/Crypto
diff options
context:
space:
mode:
Diffstat (limited to 'src/Crypto')
-rw-r--r--src/Crypto/Tox.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Crypto/Tox.hs b/src/Crypto/Tox.hs
index 61a392e2..9b097c7e 100644
--- a/src/Crypto/Tox.hs
+++ b/src/Crypto/Tox.hs
@@ -470,8 +470,9 @@ instance Read Nonce32 where
470 '=':xs -> Right xs -- optional terminating '=' 470 '=':xs -> Right xs -- optional terminating '='
471 _ -> Right ss 471 _ -> Right ss
472 bs <- Base64.decode (C8.pack $ ds ++ ['=']) 472 bs <- Base64.decode (C8.pack $ ds ++ ['='])
473 guard $ B.length bs == 32 473 if B.length bs == 32
474 return [ (Nonce32 bs, ss') ] 474 then Right [ (Nonce32 bs, ss') ]
475 else Left "Insuffiicent base64 digits while parsing Nonce32."
475 476
476instance Serialize Nonce32 where 477instance Serialize Nonce32 where
477 get = Nonce32 <$> getBytes 32 478 get = Nonce32 <$> getBytes 32