Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/polynomial_dfs.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
#include <nil/crypto3/math/polynomial/operations/lagrange_interpolation.hpp>
#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/domains/evaluation_domain.hpp>
#include <nil/crypto3/math/algorithms/make_evaluation_domain.hpp>
Expand Down
2 changes: 1 addition & 1 deletion libs/marshalling/zk/test/fri_commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <nil/crypto3/algebra/fields/arithmetic_params/mnt4.hpp>

#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
#include <nil/crypto3/math/polynomial/operations/lagrange_interpolation.hpp>
#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/domains/evaluation_domain.hpp>
#include <nil/crypto3/math/algorithms/make_evaluation_domain.hpp>
Expand Down
2 changes: 1 addition & 1 deletion libs/marshalling/zk/test/kzg_commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <nil/crypto3/algebra/fields/arithmetic_params/alt_bn128.hpp>

#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
#include <nil/crypto3/math/polynomial/operations/lagrange_interpolation.hpp>
#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/domains/evaluation_domain.hpp>
#include <nil/crypto3/math/algorithms/make_evaluation_domain.hpp>
Expand Down
2 changes: 1 addition & 1 deletion libs/marshalling/zk/test/lpc_commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/polynomial_dfs.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
#include <nil/crypto3/math/polynomial/operations/lagrange_interpolation.hpp>
#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/domains/evaluation_domain.hpp>
#include <nil/crypto3/math/algorithms/make_evaluation_domain.hpp>
Expand Down
2 changes: 1 addition & 1 deletion libs/marshalling/zk/test/placeholder_common_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp>

#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
#include <nil/crypto3/math/polynomial/operations/lagrange_interpolation.hpp>
#include <nil/crypto3/math/algorithms/calculate_domain_set.hpp>

#include <nil/crypto3/marshalling/zk/types/commitments/eval_storage.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <nil/crypto3/zk/snark/systems/plonk/placeholder/detail/profiling.hpp>

#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
#include <nil/crypto3/math/polynomial/operations/lagrange_interpolation.hpp>
#include <nil/crypto3/math/algorithms/calculate_domain_set.hpp>

#include <nil/crypto3/marshalling/zk/types/commitments/eval_storage.hpp>
Expand Down
2 changes: 1 addition & 1 deletion libs/marshalling/zk/test/polys_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/polynomial_dfs.hpp>
#include <nil/crypto3/math/polynomial/lagrange_interpolation.hpp>
#include <nil/crypto3/math/polynomial/operations/lagrange_interpolation.hpp>
#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/domains/evaluation_domain.hpp>
#include <nil/crypto3/math/algorithms/make_evaluation_domain.hpp>
Expand Down
2 changes: 1 addition & 1 deletion libs/math/docs/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ canonical storage, arithmetic operators, or alias-safe operations.

The polynomial multiplication backend concept is declared in:

<nil/crypto3/math/polynomial/polynomial_backend.hpp>
<nil/crypto3/math/polynomial/backends/polynomial_backend.hpp>

`polynomial_arithmetic::PolynomialBackend<Backend>` requires an associated `polynomial_type` that satisfies
`CoefficientPolynomial` and three operations:
Expand Down
18 changes: 9 additions & 9 deletions libs/math/docs/polynomial_arithmetic.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ The main dependency chain is:
| Facility | Header |
|---|---|
| Representation concepts | `<nil/crypto3/math/polynomial/concepts.hpp>` |
| Backend concept and arithmetic context | `<nil/crypto3/math/polynomial/polynomial_backend.hpp>` |
| Schoolbook and mixed-radix backends | `<nil/crypto3/math/polynomial/schoolbook_backend.hpp>`, `<nil/crypto3/math/polynomial/mixed_radix_backend.hpp>` |
| Power-series inversion | `<nil/crypto3/math/polynomial/power_series.hpp>` |
| Divisor context and division | `<nil/crypto3/math/polynomial/polynomial_division.hpp>` |
| GCD | `<nil/crypto3/math/polynomial/gcd.hpp>` |
| Quotient-ring multiplication | `<nil/crypto3/math/polynomial/polynomial_modular_arithmetic.hpp>` |
| Quotient-ring exponentiation | `<nil/crypto3/math/polynomial/polynomial_exponentiation.hpp>` |
| Modular composition | `<nil/crypto3/math/polynomial/polynomial_composition.hpp>` |
| Frobenius maps | `<nil/crypto3/math/polynomial/polynomial_frobenius.hpp>` |
| Backend concept and arithmetic context | `<nil/crypto3/math/polynomial/backends/polynomial_backend.hpp>` |
| Schoolbook and mixed-radix backends | `<nil/crypto3/math/polynomial/backends/schoolbook_backend.hpp>`, `<nil/crypto3/math/polynomial/backends/mixed_radix_backend.hpp>` |
| Power-series inversion | `<nil/crypto3/math/polynomial/arithmetic/power_series.hpp>` |
| Divisor context and division | `<nil/crypto3/math/polynomial/arithmetic/polynomial_division.hpp>` |
| GCD | `<nil/crypto3/math/polynomial/arithmetic/gcd.hpp>` |
| Quotient-ring multiplication | `<nil/crypto3/math/polynomial/quotient_ring/polynomial_modular_arithmetic.hpp>` |
| Quotient-ring exponentiation | `<nil/crypto3/math/polynomial/quotient_ring/polynomial_exponentiation.hpp>` |
| Modular composition | `<nil/crypto3/math/polynomial/quotient_ring/polynomial_composition.hpp>` |
| Frobenius maps | `<nil/crypto3/math/polynomial/quotient_ring/polynomial_frobenius.hpp>` |

## Multiplication backends

Expand Down
16 changes: 8 additions & 8 deletions libs/math/docs/polynomial_factorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ maps used by these stages.

| Facility | Header |
|---|---|
| Result and callback types | `<nil/crypto3/math/polynomial/polynomial_factorization.hpp>` |
| Square-free factorization | `<nil/crypto3/math/polynomial/square_free_factorization.hpp>` |
| Reference distinct-degree factorization | `<nil/crypto3/math/polynomial/distinct_degree_factorization.hpp>` |
| Kaltofen-Shoup distinct-degree factorization | `<nil/crypto3/math/polynomial/kaltofen_shoup_distinct_degree_factorization.hpp>` |
| Equal-degree factorization | `<nil/crypto3/math/polynomial/equal_degree_factorization.hpp>` |
| Complete factorization | `<nil/crypto3/math/polynomial/complete_factorization.hpp>` |
| Result and callback types | `<nil/crypto3/math/polynomial/factorization/polynomial_factorization.hpp>` |
| Square-free factorization | `<nil/crypto3/math/polynomial/factorization/square_free_factorization.hpp>` |
| Reference distinct-degree factorization | `<nil/crypto3/math/polynomial/factorization/distinct_degree_factorization.hpp>` |
| Kaltofen-Shoup distinct-degree factorization | `<nil/crypto3/math/polynomial/factorization/kaltofen_shoup_distinct_degree_factorization.hpp>` |
| Equal-degree factorization | `<nil/crypto3/math/polynomial/factorization/equal_degree_factorization.hpp>` |
| Complete factorization | `<nil/crypto3/math/polynomial/factorization/complete_factorization.hpp>` |

## Complete factorization

The simplest entry point takes a polynomial arithmetic context and a caller-owned random generator:

```cpp
#include <nil/crypto3/algebra/fields/babybear/base_field.hpp>
#include <nil/crypto3/math/polynomial/complete_factorization.hpp>
#include <nil/crypto3/math/polynomial/schoolbook_backend.hpp>
#include <nil/crypto3/math/polynomial/factorization/complete_factorization.hpp>
#include <nil/crypto3/math/polynomial/backends/schoolbook_backend.hpp>
#include <nil/crypto3/random/algebraic_engine.hpp>

namespace math = nil::crypto3::math;
Expand Down
8 changes: 4 additions & 4 deletions libs/math/docs/polynomial_recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ bounds, random sources, and any policy for combining or rejecting recovered repr
|---|---|
| Field orders and multiplicative-group decomposition | `<nil/crypto3/algebra/fields/field_order.hpp>` |
| Coefficient-field square-root helpers | `<nil/crypto3/algebra/fields/field_algorithms.hpp>` |
| Quotient-field square testing and roots | `<nil/crypto3/math/polynomial/polynomial_square_root.hpp>` |
| Bounded rational reconstruction | `<nil/crypto3/math/polynomial/polynomial_rational_reconstruction.hpp>` |
| Quotient-field square testing and roots | `<nil/crypto3/math/polynomial/quotient_ring/polynomial_square_root.hpp>` |
| Bounded rational reconstruction | `<nil/crypto3/math/polynomial/reconstruction/polynomial_rational_reconstruction.hpp>` |

## Field orders and coefficient square roots

Expand Down Expand Up @@ -70,7 +70,7 @@ characterize squares if the quotient has zero divisors.

```cpp
#include <algorithm>
#include <nil/crypto3/math/polynomial/polynomial_square_root.hpp>
#include <nil/crypto3/math/polynomial/quotient_ring/polynomial_square_root.hpp>

// B must be irreducible. Its degree is d.
const std::size_t d = B.size() - 1;
Expand Down Expand Up @@ -115,7 +115,7 @@ numerator bound, while tracking the corresponding coefficient of `R`. The return
numerator is scaled by the same field element.

```cpp
#include <nil/crypto3/math/polynomial/polynomial_rational_reconstruction.hpp>
#include <nil/crypto3/math/polynomial/reconstruction/polynomial_rational_reconstruction.hpp>

polynomial_type numerator;
polynomial_type denominator;
Expand Down
4 changes: 2 additions & 2 deletions libs/math/example/polynomials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#include <nil/crypto3/algebra/fields/arithmetic_params/bls12.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/xgcd.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/xgcd.hpp>
#include <nil/crypto3/algebra/fields/bls12/scalar_field.hpp>

#include <nil/crypto3/math/polynomial/polynomial.hpp>
Expand Down
4 changes: 2 additions & 2 deletions libs/math/example/polynomials_dfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#include <nil/crypto3/algebra/fields/arithmetic_params/bls12.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/xgcd.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/xgcd.hpp>
#include <nil/crypto3/algebra/fields/bls12/scalar_field.hpp>

#include <nil/crypto3/math/polynomial/polynomial.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <nil/crypto3/math/domains/evaluation_domain.hpp>

#include <nil/crypto3/math/polynomial/basis_change.hpp>
#include <nil/crypto3/math/polynomial/operations/basis_change.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>

namespace nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <nil/crypto3/math/algorithms/batch_inverse.hpp>
#include <nil/crypto3/math/domains/evaluation_domain.hpp>

#include <nil/crypto3/math/polynomial/basis_change.hpp>
#include <nil/crypto3/math/polynomial/operations/basis_change.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>

namespace nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <cstddef>
#include <utility>

#include <nil/crypto3/math/polynomial/half_gcd.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/half_gcd.hpp>

namespace nil::crypto3::math {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <stdexcept>
#include <utility>

#include <nil/crypto3/math/polynomial/polynomial_division.hpp>
#include <nil/crypto3/math/polynomial/shift.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/polynomial_division.hpp>
#include <nil/crypto3/math/polynomial/operations/shift.hpp>

namespace nil::crypto3::math::detail {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <stdexcept>
#include <utility>

#include <nil/crypto3/math/polynomial/power_series.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/power_series.hpp>

namespace nil::crypto3::math {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <stdexcept>
#include <utility>

#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>

namespace nil::crypto3::math {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <vector>

#include <nil/crypto3/algebra/type_traits.hpp>
#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>

namespace nil {
namespace crypto3 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include <vector>

#include <nil/crypto3/math/algorithms/mixed_radix_fft.hpp>
#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/polynomial_backend.hpp>
#include <nil/crypto3/math/polynomial/backends/polynomial_backend.hpp>

namespace nil::crypto3::math::polynomial_arithmetic {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <cstddef>
#include <utility>

#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/polynomial_backend.hpp>
#include <nil/crypto3/math/polynomial/backends/polynomial_backend.hpp>

namespace nil::crypto3::math::polynomial_arithmetic {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <utility>
#include <vector>

#include <nil/crypto3/math/polynomial/equal_degree_factorization.hpp>
#include <nil/crypto3/math/polynomial/kaltofen_shoup_distinct_degree_factorization.hpp>
#include <nil/crypto3/math/polynomial/square_free_factorization.hpp>
#include <nil/crypto3/math/polynomial/factorization/equal_degree_factorization.hpp>
#include <nil/crypto3/math/polynomial/factorization/kaltofen_shoup_distinct_degree_factorization.hpp>
#include <nil/crypto3/math/polynomial/factorization/square_free_factorization.hpp>

namespace nil::crypto3::math {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <stdexcept>
#include <utility>

#include <nil/crypto3/math/polynomial/gcd.hpp>
#include <nil/crypto3/math/polynomial/polynomial_factorization.hpp>
#include <nil/crypto3/math/polynomial/polynomial_frobenius.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/gcd.hpp>
#include <nil/crypto3/math/polynomial/factorization/polynomial_factorization.hpp>
#include <nil/crypto3/math/polynomial/quotient_ring/polynomial_frobenius.hpp>

namespace nil::crypto3::math {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

#include <nil/crypto3/algebra/fields/field_order.hpp>

#include <nil/crypto3/math/polynomial/polynomial_factorization.hpp>
#include <nil/crypto3/math/polynomial/polynomial_exponentiation.hpp>
#include <nil/crypto3/math/polynomial/factorization/polynomial_factorization.hpp>
#include <nil/crypto3/math/polynomial/quotient_ring/polynomial_exponentiation.hpp>

namespace nil::crypto3::math {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#include <vector>

#include <nil/crypto3/math/detail/integer_sqrt.hpp>
#include <nil/crypto3/math/polynomial/distinct_degree_factorization.hpp>
#include <nil/crypto3/math/polynomial/gcd.hpp>
#include <nil/crypto3/math/polynomial/polynomial_factorization.hpp>
#include <nil/crypto3/math/polynomial/polynomial_frobenius.hpp>
#include <nil/crypto3/math/polynomial/factorization/distinct_degree_factorization.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/gcd.hpp>
#include <nil/crypto3/math/polynomial/factorization/polynomial_factorization.hpp>
#include <nil/crypto3/math/polynomial/quotient_ring/polynomial_frobenius.hpp>

namespace nil::crypto3::math::detail {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include <vector>

#include <nil/crypto3/math/polynomial/concepts.hpp>
#include <nil/crypto3/math/polynomial/gcd.hpp>
#include <nil/crypto3/math/polynomial/polynomial_division.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/gcd.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/polynomial_division.hpp>

namespace nil::crypto3::math {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

#include <nil/crypto3/algebra/fields/field_order.hpp>

#include <nil/crypto3/math/polynomial/gcd.hpp>
#include <nil/crypto3/math/polynomial/polynomial_factorization.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/gcd.hpp>
#include <nil/crypto3/math/polynomial/factorization/polynomial_factorization.hpp>

namespace nil::crypto3::math {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <nil/crypto3/math/algorithms/unity_root.hpp>
#include <nil/crypto3/math/domains/detail/basic_radix2_domain_aux.hpp>
#include <nil/crypto3/math/detail/field_utils.hpp>
#include <nil/crypto3/math/polynomial/polynomial_backend.hpp>
#include <nil/crypto3/math/polynomial/backends/polynomial_backend.hpp>

namespace nil {
namespace crypto3 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include <vector>

#include <nil/crypto3/algebra/type_traits.hpp>
#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/xgcd.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/arithmetic/xgcd.hpp>

namespace nil {
namespace crypto3 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <stdexcept>

#include <nil/crypto3/algebra/type_traits.hpp>
#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>
#include <nil/crypto3/math/polynomial/polynomial_dfs.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <ranges>
#include <vector>

#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/concepts.hpp>

#include <nil/crypto3/algebra/type_traits.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include <nil/crypto3/math/algorithms/make_evaluation_domain.hpp>
#include <nil/crypto3/math/domains/evaluation_domain.hpp>
#include <nil/crypto3/math/polynomial/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/operations/basic_operations.hpp>
#include <nil/crypto3/math/polynomial/concepts.hpp>
#include <nil/crypto3/math/polynomial/polynomial.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <vector>

#include <nil/crypto3/math/detail/integer_sqrt.hpp>
#include <nil/crypto3/math/polynomial/polynomial_modular_arithmetic.hpp>
#include <nil/crypto3/math/polynomial/quotient_ring/polynomial_modular_arithmetic.hpp>

namespace nil::crypto3::math {

Expand Down
Loading
Loading