From 4bb847c8b53ff214d31ccc9adc384334d2ad7717 Mon Sep 17 00:00:00 2001 From: geet Date: Tue, 10 Sep 2024 06:24:40 +0530 Subject: [PATCH] feat: Scalar type for finite fields --- src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e412b12..25f3252 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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.