summaryrefslogtreecommitdiffhomepage
path: root/Serialization.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-11 16:33:26 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-11 16:33:26 -0400
commitb2719f6e84c0c1f49ac6ab9b60846a899563961c (patch)
tree47c93357b3362e71baf0bf83a21372ae376dfba5 /Serialization.hs
parent5decbad3eb779b1bbe11245cbde84701909e9c68 (diff)
downloadkeysafe-b2719f6e84c0c1f49ac6ab9b60846a899563961c.tar.gz
inline slightly modified version of secret-sharing
Needed for efficient serialization of shares, unless upstream takes my suggestion to make the finite field be size 256.
Diffstat (limited to 'Serialization.hs')
-rw-r--r--Serialization.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Serialization.hs b/Serialization.hs
index 224d67a..15f8881 100644
--- a/Serialization.hs
+++ b/Serialization.hs
@@ -1,6 +1,11 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
+{- Copyright 2016 Joey Hess <id@joeyh.name>
+ -
+ - Licensed under the GNU AGPL version 3 or higher.
+ -}
+
module Serialization where
import Types
@@ -24,5 +29,9 @@ instance Encodable Name where
toByteString (Name n) = n
fromByteString = Just . Name
+instance Encodable StorableObjectIdent where
+ toByteString (StorableObjectIdent i) = i
+ fromByteString = Just . StorableObjectIdent
+
sepChar :: Word8
sepChar = 32