G1

scalus.cardano.onchain.plutus.prelude.crypto.bls12_381.G1
object G1

Attributes

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

Members list

Value members

Concrete methods

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

The compressed generator of the G1 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 genG1 = G1.generator
inline def hashToGroup(bs: ByteString, dst: ByteString): G1Element

Hashes a scalus.uplc.builtin.ByteString to a point in the G1 group.

Hashes a scalus.uplc.builtin.ByteString to a point in the G1 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 G1 group.

inline def uncompress(bs: ByteString): G1Element

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

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

Attributes

BLS12 G1 zero element.

BLS12 G1 zero element.

This is the point at infinity in the BLS12-381 G1 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 zeroG1 = G1.zero

Givens

Extensions

Extensions

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

Adds two points in the G1 group

Adds two points in the G1 group

Attributes

inline def compress: ByteString

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

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

Attributes

Returns

A scalus.uplc.builtin.ByteString representing the compressed point.

inline def equal(rhs: G1Element): Boolean

Checks if two points in the G1 group are equal

Checks if two points in the G1 group are equal

Attributes

inline def scale(scalar: BigInt): G1Element

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

Exponentiates a point in the G1 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 G1 group, which is the result of multiplying the original point by the scalar.

inline def unary_-: G1Element

Negates the point in the G1 group

Negates the point in the G1 group

Attributes