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 29, 2024
1 parent 9baa836 commit 732e7e6
Show file tree
Hide file tree
Showing 7 changed files with 3,403 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 @@ -263,5 +263,13 @@ pub(crate) 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),
}
}
Loading

0 comments on commit 732e7e6

Please sign in to comment.