Expand description
Utilities for testing field implementations.
Re-exports§
pub use bench_func::*;pub use dft_testing::*;pub use extension_testing::*;pub use packedfield_testing::*;
Modules§
- bench_
func - dft_
testing - extension_
testing - from_
integer_ tests - Macros for testing the implementations of converting integers into field elements.
- packedfield_
testing
Macros§
- bench_
packed_ extension_ field - Wire up packed-extension benchmarks for one or more
(label, ScalarEF)pairs. - generate_
from_ int_ tests - generate_
from_ large_ i_ int_ tests - generate_
from_ large_ u_ int_ tests - generate_
from_ small_ int_ tests - generate_
from_ small_ neg_ int_ tests - test_
binary_ field - A
test_field!-equivalent suite for fields of characteristic 2. - test_
extension_ field - test_
field - test_
field_ dft - test_
field_ dft_ consistency - test_
field_ dft_ large - test_
frobenius - test_
packed_ binomial_ extension_ division - test_
packed_ extension_ field - test_
packed_ field - test_
packed_ field_ dot_ product_ boundary - Run the dot-product carry / boundary stress suite on a packed
PrimeField32. - test_
prime_ field - test_
prime_ field_ 32 - test_
prime_ field_ 64 - test_
ring_ with_ eq - test_
two_ adic_ extension_ field - test_
two_ adic_ field
Functions§
- test_
add_ slice - test_
batch_ multiplicative_ inverse - Verify
batch_multiplicative_inverseagainst the naive per-element inverse across a range of input lengths. - test_
binary_ ops - test_
div_ 2exp_ u64 - test_
div_ 2exp_ u64_ panics_ char2 PrimeCharacteristicRing::div_2exp_u64is documented to panic in characteristic 2.- test_
dot_ product - test_
ef_ two_ adic_ generator_ consistency - test_
field_ axioms_ proptest - Test field axioms (inverse, division) with deterministic edge cases and 256 random non-zero (x, y, z) triplets via proptest.
- test_
field_ axioms_ proptest_ char2 - Identical to
test_field_axioms_proptest, except it omits the2.inverse() == 1.halve()edge case, since2 == 0is not invertible in characteristic 2. - test_
field_ json_ serialization - Test JSON serialization and deserialization for a set of field values.
- test_
generator - Given a list of the factors of the multiplicative group of a field, check that the defined generator is actually a generator of that group.
- test_
halve_ panics_ char2 PrimeCharacteristicRing::halveis documented to panic in characteristic 2.- test_
interpolation_ nodes - Checks the fixed enumeration used for interpolation nodes.
- test_
into_ bytes_ 32 - test_
into_ bytes_ 64 - test_
into_ stream - test_
inverse - test_
inverse_ char2 - Identical to
test_inverse, except it omits the2.inverse() == 1.halve()check, since2 == 0is not invertible in characteristic 2. - test_
mul_ 2exp_ u64 - test_
mul_ 2exp_ u64_ is_ zero_ above_ e0 - In characteristic 2,
2 == 0, somul_2exp_u64(e)collapses toZEROfor everye >= 1(and is the identity ate == 0). Replacestest_mul_2exp_u64, which compares against multiplication by2^ecomputed as if2were nonzero. - test_
powers_ collect - Tests the optimized implementation of
powers.take(n).collect() - test_
powers_ collect_ char2 - Identical to
test_powers_collect, except it usesF::GENERATOR(nonzero, and notONE) as the base instead ofF::TWO. In characteristic 2,TWO == ZERO, sotest_powers_collect’s sequence of powers degenerates to[shift, ZERO, ZERO, ...]for every tested length: both the optimizedcollect_npath and the referencesuccessorschain hit that same degenerate case identically, so the test would pass while exercising essentially none of the packed/serialcollect_nmachinery it exists to cover. - test_
prime_ field_ 32_ json_ deserialization_ boundaries - Test JSON deserialization boundary behavior for 32-bit prime fields.
- test_
ring_ axioms_ proptest - Test ring axioms with 256 random (x, y, z) triplets via proptest.
- test_
ring_ axioms_ proptest_ char2 - Identical to
test_ring_axioms_proptest, except it omits thehalveroundtrip check, whichPrimeCharacteristicRing::halvedoes not support in characteristic 2. - test_
ring_ with_ eq - test_
ring_ with_ eq_ char2 - Identical to
test_ring_with_eq(), except it omits thehalveidentities, whichPrimeCharacteristicRing::halvedoes not support in characteristic 2. - test_
sqrt - Test that
Field::try_sqrtagrees with squaring. - test_
sqrt_ char2 - Test that
Field::try_sqrtagrees with squaring, in characteristic 2. - test_
sums - test_
two_ adic_ generator_ consistency - test_
two_ adic_ point_ collection