Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class ToCompressedForm a where
- serializeCompressed :: a -> Maybe ByteString
- class ToUncompressedForm a where
- serializeUncompressed :: a -> Maybe ByteString
- header :: Word8 -> Put
- elementToUncompressedForm :: ByteRepr a => a -> Maybe LByteString
- toUncompressedForm :: ByteRepr a => Point a -> Maybe LByteString
- toCompressedForm :: (ByteRepr a, FromX a, Eq a) => Point a -> Maybe LByteString
- pointFromByteString :: (Show a, Validate (Point a), ByteRepr a, FromX a) => a -> LByteString -> Either Text (Point a)
- processCompressed :: forall a. (ByteRepr a, FromX a) => a -> Word8 -> Get (Maybe (Point a))
- buildPoint :: ByteRepr a => a -> ByteString -> ByteString -> Maybe (Point a)
- getCompressionType :: Get Word8
- elementReadUncompressed :: (Validate a, Show a, ByteRepr a) => a -> LByteString -> Either Text a
- parseBS :: (Validate a, Show a) => Get (Maybe a) -> LByteString -> Either Text a
Documentation
class ToCompressedForm a where Source #
serializeCompressed :: a -> Maybe ByteString Source #
The serialisation may fail if y cannot be obtained from x
Instances
ToCompressedForm G2 Source # | |
Defined in Pairing.Group serializeCompressed :: G2 -> Maybe ByteString Source # | |
ToCompressedForm G1 Source # | |
Defined in Pairing.Group serializeCompressed :: G1 -> Maybe ByteString Source # |
class ToUncompressedForm a where Source #
serializeUncompressed :: a -> Maybe ByteString Source #
Instances
ToUncompressedForm GT Source # | |
Defined in Pairing.Group | |
ToUncompressedForm G2 Source # | |
Defined in Pairing.Group | |
ToUncompressedForm G1 Source # | |
Defined in Pairing.Group |
header :: Word8 -> Put Source #
Point serialisation using https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html It is unclear if 02 is smallest y or not so the following is used in the first 2 bytes 01 - Point at infinity 02 - Compressed repr i.e. x only but use smallest y on decode 03 - Compressed repr i.e. x only but use largest y on decode 04 -- Uncompressed repr i.e. x & y
elementToUncompressedForm :: ByteRepr a => a -> Maybe LByteString Source #
toUncompressedForm :: ByteRepr a => Point a -> Maybe LByteString Source #
toCompressedForm :: (ByteRepr a, FromX a, Eq a) => Point a -> Maybe LByteString Source #
pointFromByteString :: (Show a, Validate (Point a), ByteRepr a, FromX a) => a -> LByteString -> Either Text (Point a) Source #
processCompressed :: forall a. (ByteRepr a, FromX a) => a -> Word8 -> Get (Maybe (Point a)) Source #
buildPoint :: ByteRepr a => a -> ByteString -> ByteString -> Maybe (Point a) Source #
elementReadUncompressed :: (Validate a, Show a, ByteRepr a) => a -> LByteString -> Either Text a Source #