ref/include/scalar.c
// x is a pointer and not a scalar_t so that this function can be used to reduce
// accumulators after multiplication.
x is a pointer and not a scalar_t so that this function can be used to reduce
accumulators after multiplication.
x is a pointer and not a scalar_t so that this function can be used to reduce accumulators after multiplication .
void sub_mod_l_accum(
  scalar_t *result, const uint32_t *x,
  const scalar_t *y) {
  int64_t chain = 0;
  int i;
  for (i = 0; i < SCALAR_LIMBS; ++i) {
    chain = (chain + x[i]) - y->limbs[i];
    result->limbs[i] = chain;
    chain >>= SCALAR_LIMB_BITS;
  }
  int32_t borrow = chain;
  chain = 0;
  for (i = 0; i < SCALAR_LIMBS; ++i) {
    chain = (chain + result->limbs[i]) + (l_bits.limbs[i] & borrow);
    result->limbs[i] = chain;
    chain >>= SCALAR_LIMB_BITS;
  }
}
void sub_mod_l_accum ( scalar_t * result , const uint32_t * x , const scalar_t * y ) { int64_t chain = 0 ; int i ; for ( i = 0 ; i < SCALAR_LIMBS ; ++ i ) { chain = ( chain + x [ i ] ) - y -> limbs [ i ] ; result -> limbs [ i ] = chain ; chain >>= SCALAR_LIMB_BITS ; } int32_t borrow = chain ; chain = 0 ; for ( i = 0 ; i < SCALAR_LIMBS ; ++ i ) { chain = ( chain + result -> limbs [ i ] ) + ( l_bits . limbs [ i ] & borrow ) ; result -> limbs [ i ] = chain ; chain >>= SCALAR_LIMB_BITS ; } }
x is a pointer and not a scalar_t so that this function can be used to reduce
accumulators after multiplication.
x is a pointer and not a scalar_t so that this function can be used to reduce accumulators after multiplication .
//Should be 0 or -1 (to function as a mask)