pairing-0.3.0: Optimal ate pairing over Barreto-Naehrig curves

Safe HaskellNone
LanguageHaskell2010

Pairing.Serialize

Synopsis

Documentation

class ToCompressedForm a where Source #

Methods

serializeCompressed :: a -> Maybe ByteString Source #

The serialisation may fail if y cannot be obtained from x

Instances
ToCompressedForm G2 Source # 
Instance details

Defined in Pairing.Group

ToCompressedForm G1 Source # 
Instance details

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

processCompressed :: forall a. (ByteRepr a, FromX a) => a -> Word8 -> Get (Maybe (Point a)) Source #