Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
includes significant changes to the
bigint
andfield
modules in themopro-msm
project and the introduction of new result structures to handle carry values, updates to arithmetic functions to use these structures, and the addition of new tests for field reduction.Changes to BigInt arithmetic functions:
mopro-msm/src/msm/metal_msm/shader/bigint/bigint.metal
: Updatedbigint_add_unsafe
,bigint_add_wide
,bigint_sub
, andbigint_sub_wide
functions to use newBigIntResult
andBigIntResultWide
structures to handle carry values.Changes to field arithmetic functions:
mopro-msm/src/msm/metal_msm/shader/field/ff.metal
: Added a newff_reduce
function and updatedff_add
andff_sub
functions to use the newBigIntResult
structure.Updates to kernel functions:
mopro-msm/src/msm/metal_msm/shader/bigint/bigint_add_unsafe.metal
: Modified kernel function to use newBigIntResult
structure.mopro-msm/src/msm/metal_msm/shader/field/ff_add.metal
: Updated kernel function to use newff_add
function.Addition of new tests:
mopro-msm/src/msm/metal_msm/tests/field/ff_reduce.rs
: Added new tests for theff_reduce
function to ensure correct behavior whena
is less thanp
and whena
is betweenp
and2p
.mopro-msm/src/msm/metal_msm/tests/field/mod.rs
: Included the newff_reduce
test module.Structural changes:
mopro-msm/src/msm/metal_msm/shader/misc/types.metal
: Added newBigIntResult
andBigIntResultWide
structures to handle carry values in arithmetic operations.