cardano-crypto-class-2.2.0.0: Type classes abstracting over cryptography primitives for Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Crypto.EllipticCurve.BLS12_381

Synopsis

Types

data Point curve Source #

A point on an elliptic curve. This type guarantees that the point is part of the | prime order subgroup.

Instances

Instances details
BLS curve ⇒ Eq (Point curve) Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

Methods

(==)Point curve → Point curve → Bool Source #

(/=)Point curve → Point curve → Bool Source #

data PT Source #

Target element without the final exponantiation. By defining target elements | as such, we save up the final exponantiation when computing a pairing, and only | compute it when necessary (e.g. comparison with another point or serialisation)

Instances

Instances details
Eq PT Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

Methods

(==)PTPTBool Source #

(/=)PTPTBool Source #

data BLSTError Source #

Instances

Instances details
Bounded BLSTError Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

Enum BLSTError Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

Show BLSTError Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

Eq BLSTError Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

Ord BLSTError Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

BLS Class

class BLS curve Source #

BLS curve operations. Class methods are low-level; user code will want to use higher-level wrappers such as blsAddOrDouble, blsMult, blsCneg, blsNeg, etc.

Instances

Instances details
BLS Curve1 Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

BLS Curve2 Source # 
Instance details

Defined in Cardano.Crypto.EllipticCurve.BLS12_381.Internal

Point / Group operations

These work on both curves, and take phantom parameters of type Curve1 or Curve2 to select one of the two provided elliptic curves.

blsInGroupBLS curve ⇒ Point curve → Bool Source #

Check whether a point is in the group corresponding to its elliptic curve

blsAddOrDoubleBLS curve ⇒ Point curve → Point curve → Point curve Source #

Curve point addition.

blsMultBLS curve ⇒ Point curve → IntegerPoint curve Source #

Scalar multiplication of a curve point. The scalar will be brought into the range of modular arithmetic by means of a modulo operation over the scalarPeriod. Negative number will also be brought to the range [0, scalarPeriod - 1] via modular reduction.

blsCnegBLS curve ⇒ Point curve → BoolPoint curve Source #

Conditional curve point negation. blsCneg x cond = if cond then neg x else x

blsNegBLS curve ⇒ Point curve → Point curve Source #

Unconditional curve point negation

blsCompress ∷ ∀ curve. BLS curve ⇒ Point curve → ByteString Source #

blsSerialize ∷ ∀ curve. BLS curve ⇒ Point curve → ByteString Source #

blsUncompress ∷ ∀ curve. BLS curve ⇒ ByteStringEither BLSTError (Point curve) Source #

blsDeserialize ∷ ∀ curve. BLS curve ⇒ ByteStringEither BLSTError (Point curve) Source #

blsHashBLS curve ⇒ ByteStringMaybe ByteStringMaybe ByteStringPoint curve Source #

blsHash msg mDST mAug generates the elliptic curve blsHash for the given message msg; mDST and mAug are the optional aug and dst arguments.

blsGeneratorBLS curve ⇒ Point curve Source #

blsIsInfBLS curve ⇒ Point curve → Bool Source #

Infinity check on curve points.

PT operations

ptMultPTPTPT Source #

Pairings

The period (modulo) of scalars

scalarPeriodInteger Source #

The period of scalar modulo operations.