mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +00:00
Feature-gate batch inversion and compression on alloc
This commit is contained in:
parent
b20ccbd685
commit
1f821d34a5
2 changed files with 2 additions and 0 deletions
|
|
@ -184,6 +184,7 @@ impl FieldElement {
|
||||||
///
|
///
|
||||||
/// This function is most efficient when the batch size (slice
|
/// This function is most efficient when the batch size (slice
|
||||||
/// length) is a power of 2.
|
/// length) is a power of 2.
|
||||||
|
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||||
pub fn batch_invert(inputs: &mut [FieldElement]) {
|
pub fn batch_invert(inputs: &mut [FieldElement]) {
|
||||||
// First, compute the product of all inputs using a product
|
// First, compute the product of all inputs using a product
|
||||||
// tree:
|
// tree:
|
||||||
|
|
|
||||||
|
|
@ -667,6 +667,7 @@ impl RistrettoPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Double-and-compress a batch of points.
|
/// Double-and-compress a batch of points.
|
||||||
|
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||||
pub fn double_and_compress_batch<'a, I>(points: I) -> Vec<CompressedRistretto>
|
pub fn double_and_compress_batch<'a, I>(points: I) -> Vec<CompressedRistretto>
|
||||||
where I: IntoIterator<Item = &'a RistrettoPoint>
|
where I: IntoIterator<Item = &'a RistrettoPoint>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue