Skip to main content

primitives/types/heap_array/
mod.rs

1pub mod array;
2pub mod matrix;
3pub mod ops;
4
5pub use array::{HeapArray, HeapArrayTuple};
6pub use matrix::{HeapMatrix, RowMajorHeapMatrix};
7
8use crate::{
9    algebra::{
10        elliptic_curve::{Point, Scalar, ScalarAsExtension},
11        field::{FieldElement, SubfieldElement},
12    },
13    types::{Batched, Positive},
14};
15
16impl<T: Sized + Send, M: Positive> Batched for HeapArray<T, M> {
17    type Size = M;
18}
19
20// === Type aliases === //
21
22/// A batch of `M` field elements of type `F`.
23pub type FieldElements<F, M> = HeapArray<FieldElement<F>, M>;
24
25/// A batch of `M` subfield elements of type `F`.
26pub type SubfieldElements<F, M> = HeapArray<SubfieldElement<F>, M>;
27
28/// A batch of `M` scalar elements of type `C::Scalar`.
29pub type Scalars<C, M> = HeapArray<Scalar<C>, M>;
30
31/// A batch of `M` scalar elements of type `C::ScalarAsExtension`.
32pub type ScalarsAsExtension<C, M> = HeapArray<ScalarAsExtension<C>, M>;
33
34/// A batch of `M` curve points of type `C::Point`.
35pub type CurvePoints<C, M> = HeapArray<Point<C>, M>;