Add multiplicative generator and other useful constants.

This commit is contained in:
Sean Bowe
2017-06-27 09:14:24 -06:00
parent 9aceb63e7e
commit b1f392ac99
2 changed files with 56 additions and 15 deletions
+11
View File
@@ -147,6 +147,17 @@ pub trait PrimeField: Field
/// Returns how many bits of information can be reliably stored in the
/// field element.
fn capacity() -> u32;
/// Returns the multiplicative generator of `char()` - 1 order. This element
/// must also be quadratic nonresidue.
fn multiplicative_generator() -> Self;
/// Returns s such that 2^s * t = `char()` - 1 with t odd.
fn s() -> usize;
/// Returns the 2^s root of unity computed by exponentiating the `multiplicative_generator()`
/// by t.
fn root_of_unity() -> Self;
}
pub struct BitIterator<E> {