core: remove MulAssign impl for Scalar
This commit is contained in:
parent
6e5aff8342
commit
d518c5c5cf
|
@ -4,6 +4,13 @@ Entries are listed in reverse chronological order.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## 2.0.0
|
||||||
|
|
||||||
|
* Removed the `MulAssign<Identifier<C>> for Scalar<C>` implementation since it
|
||||||
|
will result in a coherence error in future Rust versions (see #625). In the
|
||||||
|
unlikely case you're using this, you can replace e.g. `scalar *= identifier`
|
||||||
|
with `scalar = identifier * scalar`.
|
||||||
|
|
||||||
## Released
|
## Released
|
||||||
|
|
||||||
## 1.0.0
|
## 1.0.0
|
||||||
|
|
|
@ -149,15 +149,6 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<C> std::ops::MulAssign<Identifier<C>> for Scalar<C>
|
|
||||||
where
|
|
||||||
C: Ciphersuite,
|
|
||||||
{
|
|
||||||
fn mul_assign(&mut self, identifier: Identifier<C>) {
|
|
||||||
*self = *self * identifier.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<C> std::ops::Sub for Identifier<C>
|
impl<C> std::ops::Sub for Identifier<C>
|
||||||
where
|
where
|
||||||
C: Ciphersuite,
|
C: Ciphersuite,
|
||||||
|
|
|
@ -610,7 +610,7 @@ fn evaluate_polynomial<C: Ciphersuite>(
|
||||||
let ell_scalar = identifier;
|
let ell_scalar = identifier;
|
||||||
for coeff in coefficients.iter().skip(1).rev() {
|
for coeff in coefficients.iter().skip(1).rev() {
|
||||||
value = value + *coeff;
|
value = value + *coeff;
|
||||||
value *= ell_scalar;
|
value = ell_scalar * value;
|
||||||
}
|
}
|
||||||
value = value
|
value = value
|
||||||
+ *coefficients
|
+ *coefficients
|
||||||
|
|
|
@ -302,12 +302,12 @@ fn compute_lagrange_coefficient<C: Ciphersuite>(
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(x) = x {
|
if let Some(x) = x {
|
||||||
num *= x - *x_j;
|
num = (x - *x_j) * num;
|
||||||
den *= x_i - *x_j;
|
den = (x_i - *x_j) * den;
|
||||||
} else {
|
} else {
|
||||||
// Both signs inverted just to avoid requiring Neg (-*xj)
|
// Both signs inverted just to avoid requiring Neg (-*xj)
|
||||||
num *= *x_j;
|
num = *x_j * num;
|
||||||
den *= *x_j - x_i;
|
den = (*x_j - x_i) * den;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !x_i_found {
|
if !x_i_found {
|
||||||
|
|
Loading…
Reference in New Issue