Skip to content

Commit 6a11701

Browse files
authored
elliptic-curve: add #[inline] to LUT methods (#2131)
Noticed a ~10% performance regression on basepoint multiplication, and this seemed to help
1 parent bcf7961 commit 6a11701

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

elliptic-curve/src/point/lookup_table.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ where
2626
pub const SIZE: usize = LUT_SIZE;
2727

2828
/// Compute a new lookup table from the given point.
29+
#[inline]
2930
pub fn new(p: Point) -> Self {
3031
let mut points = [p; LUT_SIZE];
3132

@@ -38,6 +39,7 @@ where
3839

3940
/// Given `-8 <= x <= 8`, returns `x * p` in constant time.
4041
#[allow(clippy::cast_sign_loss)]
42+
#[inline]
4143
pub fn select(&self, x: i8) -> Point {
4244
debug_assert!((-8..=8).contains(&x));
4345

0 commit comments

Comments
 (0)