Skip to content

Commit

Permalink
extra stuff for if c divides field bit size
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfdp committed Jun 8, 2024
1 parent 35c07ae commit ac65592
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions icicle/src/msm/msm.cu
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ namespace msm {
unsigned msm_index = tid / msm_size;
const S& scalar = scalars[tid];
// if field bit count divides c we need to negate both the point and scalar if the msb is set to avoid overflow
if (S::NBITS % c == 0){
if (scalars[tid].get_scalar_digit(S::NBITS - 1, 1)){
negate_point = true;
}
}

// if (S::NBITS % c == 0){
// if (scalar.get_scalar_digit(S::NBITS, 1)){
// scalar = S::neg(scalar);
// negate_point = true;
// }
// }
const S& scalar = negate_point ? S::neg(scalars[tid]) : scalars[tid];

for (unsigned bm = 0; bm < nof_bms; bm++) {
const unsigned precomputed_index = bm / precomputed_bms_stride;
Expand Down

0 comments on commit ac65592

Please sign in to comment.