Expand description
Utility functions for converting between different types of field elements.
Modules§
- fs
- Module for reading parameters for Halo2 proving system from the file system.
- halo2
- Helper functions for raw halo2 operations to unify slight differences in API for halo2-axiom and halo2-pse
Traits§
- BigPrime
Field - Helper trait to convert to and from a BigPrimeField by converting a list of u64 digits
- Curve
Affine Ext - Scalar
Field - Helper trait to represent a field element that can be converted into u64 limbs.
Functions§
- bigint_
to_ fe - Converts an immutable reference to BigInt to a BigPrimeField.
- biguint_
to_ fe - Converts an immutable reference to BigUint to a BigPrimeField.
- bit_
length - Returns the number of bits needed to represent the value of
x
. - compose
- Computes the value of an integer by passing as
input
a Vec of its limb values and thebit_len
(bit length) used. - decompose
- Decomposes an immutable reference to a BigPrimeField element into
number_of_limbs
limbs ofbit_len
bits each and returns a Vec of BigPrimeField represented by those limbs. - decompose_
bigint - Decomposes an immutable reference to a BigInt into
num_limbs
limbs ofbit_len
bits each and returns a Vec of BigPrimeField represented by those limbs. - decompose_
bigint_ option - Decomposes an immutable reference to a BigInt into
num_limbs
limbs ofbit_len
bits each and returns a Vec of BigPrimeField represented by those limbs wrapped in Value. - decompose_
biguint - Decomposes an immutable reference to a BigUint into
num_limbs
limbs ofbit_len
bits each and returns a Vec of BigPrimeField represented by those limbs. - decompose_
fe_ to_ u64_ limbs - Decomposes an immutable reference to a ScalarField element into
number_of_limbs
limbs ofbit_len
bits each and returns a Vec of u64 represented by those limbs. - fe_
to_ bigint - Converts a BigPrimeField element into a BigInt element by sending
fe
in[0, F::modulus())
to - fe_
to_ biguint - Converts an immutable reference to an PrimeField element into a BigUint element.
- log2_
ceil - Returns the ceiling of the base 2 logarithm of
x
. - modulus
- Returns the modulus of BigPrimeField.
- power_
of_ two - Returns the BigPrimeField element of 2n.
- value_
to_ option - Wraps the internal value of
value
in an Option. If the value is None, then the function returns None.