Skip to content

Commit

Permalink
Add vector backend for computing δ(aA + bB - C) in variable time
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Mar 30, 2024
1 parent ee6bba2 commit fd8952c
Show file tree
Hide file tree
Showing 7 changed files with 3,423 additions and 1 deletion.
10 changes: 9 additions & 1 deletion curve25519-dalek/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,13 @@ pub fn scalar_mul_abglsv_pornin(
b: &Scalar,
C: &EdwardsPoint,
) -> EdwardsPoint {
serial::scalar_mul::abglsv_pornin::mul(a, A, b, C)
match get_selected_backend() {
#[cfg(curve25519_dalek_backend = "simd")]
BackendKind::Avx2 => vector::scalar_mul::abglsv_pornin::spec_avx2::mul(a, A, b, C),
#[cfg(all(curve25519_dalek_backend = "simd", nightly))]
BackendKind::Avx512 => {
vector::scalar_mul::abglsv_pornin::spec_avx512ifma_avx512vl::mul(a, A, b, C)
}
BackendKind::Serial => serial::scalar_mul::abglsv_pornin::mul(a, A, b, C),
}
}

0 comments on commit fd8952c

Please sign in to comment.