G2

scalus.prelude.crypto.bls12_381.G2
object G2

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
G2.type

Members list

Value members

Concrete methods

The compressed generator of the G2 group of the BLS12-381 curve.

The compressed generator of the G2 group of the BLS12-381 curve.

Attributes

Note

This is a function, not a constant deliberately. Being a constant would make it always initialize in your Plutus script (which is not cheap) even if the BLS12-381 is not used in the evaluated code. Hence, to avoid multiple initializations, please create a local variable in the scope where you need it, like:

   val genG2 = G2.generator

Hashes a ByteString to a point in the G2 group.

Hashes a ByteString to a point in the G2 group.

Value parameters

bs

The byte string to hash.

dst

The domain separation tag, which should be a short byte string (up to 255 bytes).

Attributes

Returns

A point in the G2 group.

Uncompresses a point in the G2 group from its compressed form.

Uncompresses a point in the G2 group from its compressed form.

Attributes

BLS12 G2 zero element.

BLS12 G2 zero element.

This is the point at infinity in the BLS12-381 G2 group

Attributes

Note

This is a function, not a constant deliberately. Being a constant would make it always initialize in your Plutus script (which is not cheap) even if the BLS12-381 is not used in the evaluated code. Hence, to avoid multiple initializations, please create a local variable in the scope where you need it, like:

   val zeroG2 = G2.zero

Extensions

Extensions

extension (self: BLS12_381_G2_Element)
infix inline def +(rhs: BLS12_381_G2_Element): BLS12_381_G2_Element

Adds two points in the G2 group

Adds two points in the G2 group

Attributes

inline def compress: ByteString

Compresses the point in the G2 group to its compressed form.

Compresses the point in the G2 group to its compressed form.

Attributes

Returns

A ByteString representing the compressed point.

inline def equal(rhs: BLS12_381_G2_Element): Boolean

Checks if two points in the G2 group are equal

Checks if two points in the G2 group are equal

Attributes

inline def scale(scalar: BigInt): BLS12_381_G2_Element

Exponentiates a point in the G2 group with a scalar. This operation is equivalent to the repeated addition of the point with itself e times.

Exponentiates a point in the G2 group with a scalar. This operation is equivalent to the repeated addition of the point with itself e times.

Value parameters

scalar

The scalar to multiply the point by.

Attributes

Returns

A new point in the G2 group, which is the result of multiplying the original point by the scalar.

Negates the point in the G2 group

Negates the point in the G2 group

Attributes