Module utils

Module utils 

Source

Structs§

MiscParams
Miscellaneous parameters for the WebGPU shader

Functions§

bytes_to_field
Convert bytes to a field element
calc_bitwidth
Calculate the bitwidth of the field characteristic
calc_inv_and_pprime
Calculate the Montgomery inverse and the Montgomery reduction parameter
calc_rinv_and_n0
Calculate the Montgomery radix inverse and the Montgomery reduction parameter
compute_misc_params
Compute miscellaneous parameters for the WebGPU shader
debug
Debug print
field_to_bytes
Convert a field element to bytes
field_to_u8_vec_for_gpu
Split a field element into limbs and convert each limb to a vector of bytes.
fields_to_u8_vec_for_gpu
Split each field element into limbs and convert each limb to a vector of bytes.
from_words_le_without_assertion
Convert u16 limbs into a field element
gen_mu
Generate the Montgomery magic number
gen_mu_limbs
Generate the GPU representation of the Montgomery magic number
gen_one_limbs
Generate the GPU representation of one
gen_p_limbs
Generate the GPU representation of the field characteristic
gen_p_limbs_plus_one
Generate the GPU representation of the field characteristic padded with a zero limb
gen_r_limbs
Generate the GPU representation of the Montgomery radix
gen_rinv_limbs
Generate the GPU representation of the Montgomery radix inverse
gen_zero_limbs
Generate the GPU representation of zero
points_to_bytes_for_gpu
Convert a vector of points to a vector of bytes
to_biguint_le
Convert a vector of u32 limbs into a BigUint
to_words_le
Convert a BigUint into u32 limbs
to_words_le_from_field
Convert a field element into u32 limbs
to_words_le_from_le_bytes
Convert a binary representation into u32 limbs.
u8s_to_field_without_assertion
Convert a vector of bytes into a field element
u8s_to_fields_without_assertion
Convert a vector of bytes into a vector of field elements