Skip to content

Commit

Permalink
feat: Scalar type for finite fields
Browse files Browse the repository at this point in the history
  • Loading branch information
geet-eth committed Sep 10, 2024
1 parent 08bface commit 4bb847c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,14 @@ pub trait Field: EuclideanDomain + MultiplicativeAbelianGroup {}
/// # Properties
/// - The number of elements is always a prime power p^n
pub trait FiniteField: Field {
///allos for an arbitrary size representation without specificing type
type ScalarType: Clone + PartialOrd + Zero + One + Debug;

/// Returns the characteristic of the field.
fn characteristic() -> u64;
fn characteristic() -> Self::ScalarType;

/// Returns the number of elements in the field.
fn order() -> u64;
fn order() -> Self::ScalarType;
}

/// Represents an Ordered Field, a field with a total order compatible with its operations.
Expand Down

0 comments on commit 4bb847c

Please sign in to comment.