Skip to content

Commit af3e731

Browse files
committed
Simplify double-and-add code
1 parent f7fbc20 commit af3e731

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ed448-goldilocks/src/curve/scalar_mul/variable_base.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ mod test {
5353
// XXX: Would be great if subtle had a From<u32> for Choice. But maybe that is not it's purpose?
5454
for bit in s_bits.into_iter().rev() {
5555
result = result.double();
56-
57-
let mut p = ExtendedPoint::IDENTITY;
58-
p.conditional_assign(point, Choice::from(bit as u8));
59-
result = result.add(&p);
56+
result.conditional_assign(&result.add(point), Choice::from(u8::from(bit)));
6057
}
6158

6259
result

0 commit comments

Comments
 (0)