Skip to main content

Crate p3_field_testing

Crate p3_field_testing 

Source
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_inverse against 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_u64 is 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 the 2.inverse() == 1.halve() edge case, since 2 == 0 is 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::halve is 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 the 2.inverse() == 1.halve() check, since 2 == 0 is not invertible in characteristic 2.
test_mul_2exp_u64
test_mul_2exp_u64_is_zero_above_e0
In characteristic 2, 2 == 0, so mul_2exp_u64(e) collapses to ZERO for every e >= 1 (and is the identity at e == 0). Replaces test_mul_2exp_u64, which compares against multiplication by 2^e computed as if 2 were nonzero.
test_powers_collect
Tests the optimized implementation of powers.take(n).collect()
test_powers_collect_char2
Identical to test_powers_collect, except it uses F::GENERATOR (nonzero, and not ONE) as the base instead of F::TWO. In characteristic 2, TWO == ZERO, so test_powers_collect’s sequence of powers degenerates to [shift, ZERO, ZERO, ...] for every tested length: both the optimized collect_n path and the reference successors chain hit that same degenerate case identically, so the test would pass while exercising essentially none of the packed/serial collect_n machinery 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 the halve roundtrip check, which PrimeCharacteristicRing::halve does not support in characteristic 2.
test_ring_with_eq
test_ring_with_eq_char2
Identical to test_ring_with_eq(), except it omits the halve identities, which PrimeCharacteristicRing::halve does not support in characteristic 2.
test_sqrt
Test that Field::try_sqrt agrees with squaring.
test_sqrt_char2
Test that Field::try_sqrt agrees with squaring, in characteristic 2.
test_sums
test_two_adic_generator_consistency
test_two_adic_point_collection