diff --git a/k256/src/arithmetic/field.rs b/k256/src/arithmetic/field.rs index 6e97ee78..7e68f1b4 100644 --- a/k256/src/arithmetic/field.rs +++ b/k256/src/arithmetic/field.rs @@ -323,6 +323,7 @@ impl PrimeField for FieldElement { } impl ConditionallySelectable for FieldElement { + #[inline(always)] fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self { Self(FieldElementImpl::conditional_select(&(a.0), &(b.0), choice)) } diff --git a/k256/src/arithmetic/field/field_10x26.rs b/k256/src/arithmetic/field/field_10x26.rs index d3c5706d..6ea525a0 100644 --- a/k256/src/arithmetic/field/field_10x26.rs +++ b/k256/src/arithmetic/field/field_10x26.rs @@ -674,6 +674,7 @@ impl Default for FieldElement10x26 { } impl ConditionallySelectable for FieldElement10x26 { + #[inline(always)] fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self { Self([ u32::conditional_select(&a.0[0], &b.0[0], choice), diff --git a/k256/src/arithmetic/field/field_5x52.rs b/k256/src/arithmetic/field/field_5x52.rs index 06735ade..3653ec50 100644 --- a/k256/src/arithmetic/field/field_5x52.rs +++ b/k256/src/arithmetic/field/field_5x52.rs @@ -461,6 +461,7 @@ impl Default for FieldElement5x52 { } impl ConditionallySelectable for FieldElement5x52 { + #[inline(always)] fn conditional_select( a: &FieldElement5x52, b: &FieldElement5x52, diff --git a/k256/src/arithmetic/field/field_impl.rs b/k256/src/arithmetic/field/field_impl.rs index 4fa1f4f5..6c7820b1 100644 --- a/k256/src/arithmetic/field/field_impl.rs +++ b/k256/src/arithmetic/field/field_impl.rs @@ -142,6 +142,7 @@ impl Default for FieldElementImpl { } impl ConditionallySelectable for FieldElementImpl { + #[inline(always)] fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self { // 1. It's debug only, so it shouldn't present a security risk // 2. Being normalized does is independent from the field element value; diff --git a/p256/src/arithmetic/field.rs b/p256/src/arithmetic/field.rs index ea153a88..86462f6a 100644 --- a/p256/src/arithmetic/field.rs +++ b/p256/src/arithmetic/field.rs @@ -473,6 +473,7 @@ impl PrimeField for FieldElement { } impl ConditionallySelectable for FieldElement { + #[inline(always)] fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self { Self(U256::conditional_select(&a.0, &b.0, choice)) } diff --git a/primeorder/src/affine.rs b/primeorder/src/affine.rs index 3fb01d90..6801c5d3 100644 --- a/primeorder/src/affine.rs +++ b/primeorder/src/affine.rs @@ -96,6 +96,7 @@ impl ConditionallySelectable for AffinePoint where C: PrimeCurveParams, { + #[inline(always)] fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self { Self { x: C::FieldElement::conditional_select(&a.x, &b.x, choice), diff --git a/primeorder/src/projective.rs b/primeorder/src/projective.rs index 5549543f..dc30f532 100644 --- a/primeorder/src/projective.rs +++ b/primeorder/src/projective.rs @@ -172,6 +172,7 @@ impl ConditionallySelectable for ProjectivePoint where C: PrimeCurveParams, { + #[inline(always)] fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self { Self { x: C::FieldElement::conditional_select(&a.x, &b.x, choice),