Attributes
Members list
Type members
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Creates a new Scalar from a BigInt value.
Creates a new Scalar from a BigInt value.
Value parameters
- n
-
the BigInt value to convert
Attributes
- Returns
-
Some(Scalar) if the value is within the valid field range, None otherwise
Creates a new Scalar from a string representation of a number.
Creates a new Scalar from a string representation of a number.
Value parameters
- s
-
the string representation of the number
Attributes
- Returns
-
Some(Scalar) if the value is within the valid field range, None otherwise
Creates a new Scalar from a BigInt value without safety checks, throws when the argument is not valid.
Creates a new Scalar from a BigInt value without safety checks, throws when the argument is not valid.
Value parameters
- n
-
the BigInt value to convert
Attributes
- Returns
-
Scalar instance
- Throws
-
IllegalArgumentException
if the value is not in the valid field range
Creates a Scalar from a big-endian byte string representation.
Creates a Scalar from a big-endian byte string representation.
Value parameters
- bytes
-
the big-endian byte string to convert
Attributes
- Returns
-
Some(Scalar) if the value is within the valid field range, None otherwise
Creates a Scalar from a big-endian byte string representation without safety checks.
Creates a Scalar from a big-endian byte string representation without safety checks.
Value parameters
- bytes
-
the big-endian byte string to convert
Attributes
- Returns
-
Scalar instance
- Throws
-
IllegalArgumentException
if the value is not in the valid field range
Creates a Scalar from a little-endian byte string representation.
Creates a Scalar from a little-endian byte string representation.
Value parameters
- bytes
-
the little-endian byte string to convert
Attributes
- Returns
-
Some(Scalar) if the value is within the valid field range, None otherwise
Creates a Scalar from a little-endian byte string representation without safety checks.
Creates a Scalar from a little-endian byte string representation without safety checks.
Value parameters
- bytes
-
the little-endian byte string to convert
Attributes
- Returns
-
Scalar instance
- Throws
-
IllegalArgumentException
if the value is not in the valid field range
Returns a Scalar instance representing one in the field.
Returns a Scalar instance representing one in the field.
Attributes
Concrete fields
The prime number defining the scalar field of the BLS12-381 curve.
The prime number defining the scalar field of the BLS12-381 curve.
Attributes
Extensions
Extensions
Multiplies two Scalar elements in the finite field.
Multiplies two Scalar elements in the finite field.
Value parameters
- multiplier
-
the Scalar to multiply by
Attributes
- Returns
-
a new Scalar representing the product
Adds two Scalar elements in the finite field.
Adds two Scalar elements in the finite field.
Value parameters
- addend
-
the Scalar to add
Attributes
- Returns
-
a new Scalar representing the sum
Subtracts one Scalar from another in the finite field.
Subtracts one Scalar from another in the finite field.
Value parameters
- subtrahend
-
the Scalar to subtract
Attributes
- Returns
-
a new Scalar representing the difference
Divides one Scalar by another in the finite field.
Divides one Scalar by another in the finite field.
Value parameters
- divisor
-
the Scalar to divide by
Attributes
- Returns
-
Some(Scalar) representing the quotient, or None if divisor is zero
Calculates the multiplicative inverse of this Scalar.
Calculates the multiplicative inverse of this Scalar.
Attributes
- Returns
-
Some(Scalar) representing the inverse, or None if this Scalar is zero
Raises the Scalar to a power using repeated squaring algorithm.
Raises the Scalar to a power using repeated squaring algorithm.
Value parameters
- e
-
the exponent
Attributes
- Returns
-
a new Scalar representing
self^e
- Note
-
Returns zero for negative exponents
Optimized power operation for powers of 2.
Optimized power operation for powers of 2.
Value parameters
- k
-
the power of 2 exponent (i.e., calculating
self^(2^k)
)
Attributes
- Returns
-
a new Scalar representing
self^(2^k)
- Note
-
Returns zero for negative k
Converts this Scalar to a big-endian byte string representation.
Converts this Scalar to a big-endian byte string representation.
Value parameters
- size
-
the desired size of the resulting byte string
Attributes
- Returns
-
ByteString representation in big-endian format
Converts this Scalar to a little-endian byte string representation.
Converts this Scalar to a little-endian byte string representation.
Value parameters
- size
-
the desired size of the resulting byte string
Attributes
- Returns
-
ByteString representation in little-endian format
Converts this Scalar to its BigInt representation.
Converts this Scalar to its BigInt representation.
Attributes
- Returns
-
the BigInt value representing this Scalar