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, M: Positive> Batched for HeapArray<T, M> {
17    type Item = T;
18    type Size = M;
19}
20
21// === Type aliases === //
22
23/// A batch of `M` field elements of type `F`.
24pub type FieldElements<F, M> = HeapArray<FieldElement<F>, M>;
25
26/// A batch of `M` subfield elements of type `F`.
27pub type SubfieldElements<F, M> = HeapArray<SubfieldElement<F>, M>;
28
29/// A batch of `M` scalar elements of type `C::Scalar`.
30pub type Scalars<C, M> = HeapArray<Scalar<C>, M>;
31
32/// A batch of `M` scalar elements of type `C::ScalarAsExtension`.
33pub type ScalarsAsExtension<C, M> = HeapArray<ScalarAsExtension<C>, M>;
34
35/// A batch of `M` curve points of type `C::Point`.
36pub type CurvePoints<C, M> = HeapArray<Point<C>, M>;