passagemath-modules 10.5.32__cp310-cp310-macosx_14_0_arm64.whl → 10.6.20__cp310-cp310-macosx_14_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-modules might be problematic. Click here for more details.
- {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +51 -46
- {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +333 -323
- {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +1 -1
- passagemath_modules.dylibs/libgcc_s.1.1.dylib +0 -0
- passagemath_modules.dylibs/libgfortran.5.dylib +0 -0
- passagemath_modules.dylibs/libgsl.28.dylib +0 -0
- passagemath_modules.dylibs/libmpc.3.dylib +0 -0
- passagemath_modules.dylibs/libopenblasp-r0.3.29.dylib +0 -0
- passagemath_modules.dylibs/libquadmath.0.dylib +0 -0
- sage/algebras/clifford_algebra.py +2 -2
- sage/algebras/clifford_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/clifford_algebra_element.pyx +4 -2
- sage/algebras/exterior_algebra_groebner.cpython-310-darwin.so +0 -0
- sage/algebras/exterior_algebra_groebner.pyx +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +83 -5
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +28 -3
- sage/algebras/finite_gca.py +1 -1
- sage/algebras/lie_algebras/bgg_dual_module.py +18 -11
- sage/algebras/lie_algebras/classical_lie_algebra.py +3 -3
- sage/algebras/lie_algebras/examples.py +2 -2
- sage/algebras/lie_algebras/free_lie_algebra.py +1 -1
- sage/algebras/lie_algebras/heisenberg.py +4 -4
- sage/algebras/lie_algebras/lie_algebra.py +1 -1
- sage/algebras/lie_algebras/lie_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/lie_algebras/lie_algebra_element.pyx +65 -28
- sage/algebras/lie_algebras/quotient.py +40 -29
- sage/algebras/lie_algebras/subalgebra.py +76 -53
- sage/algebras/lie_algebras/verma_module.py +1 -3
- sage/algebras/octonion_algebra.cpython-310-darwin.so +0 -0
- sage/algebras/octonion_algebra.pyx +1 -1
- sage/algebras/orlik_solomon.py +4 -4
- sage/algebras/orlik_terao.py +4 -4
- sage/algebras/steenrod/steenrod_algebra.py +37 -30
- sage/algebras/steenrod/steenrod_algebra_bases.py +2 -2
- sage/algebras/steenrod/steenrod_algebra_misc.py +4 -4
- sage/algebras/steenrod/steenrod_algebra_mult.py +2 -2
- sage/all__sagemath_modules.py +1 -0
- sage/calculus/integration.cpython-310-darwin.so +0 -0
- sage/calculus/integration.pyx +6 -5
- sage/calculus/interpolation.cpython-310-darwin.so +0 -0
- sage/calculus/interpolators.cpython-310-darwin.so +0 -0
- sage/calculus/ode.cpython-310-darwin.so +0 -0
- sage/calculus/ode.pxd +2 -2
- sage/calculus/ode.pyx +6 -4
- sage/calculus/riemann.cpython-310-darwin.so +0 -0
- sage/calculus/riemann.pyx +68 -48
- sage/calculus/transforms/dwt.cpython-310-darwin.so +0 -0
- sage/calculus/transforms/fft.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.pyx +31 -31
- sage/coding/binary_code.cpython-310-darwin.so +0 -0
- sage/coding/binary_code.pxd +6 -6
- sage/coding/binary_code.pyx +212 -173
- sage/coding/guruswami_sudan/utils.py +3 -5
- sage/coding/kasami_codes.cpython-310-darwin.so +0 -0
- sage/coding/kasami_codes.pyx +20 -24
- sage/coding/linear_code.py +2 -2
- sage/coding/linear_code_no_metric.py +5 -5
- sage/coding/linear_rank_metric.py +81 -19
- sage/combinat/cartesian_product.py +1 -1
- sage/combinat/free_module.py +22 -2
- sage/combinat/root_system/all.py +1 -1
- sage/combinat/root_system/ambient_space.py +1 -1
- sage/combinat/root_system/associahedron.py +4 -4
- sage/combinat/root_system/braid_move_calculator.py +2 -2
- sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
- sage/combinat/root_system/braid_orbit.pyx +1 -1
- sage/combinat/root_system/branching_rules.py +3 -3
- sage/combinat/root_system/cartan_type.py +14 -14
- sage/combinat/root_system/coxeter_group.py +3 -3
- sage/combinat/root_system/coxeter_matrix.py +1 -1
- sage/combinat/root_system/coxeter_type.py +12 -1
- sage/combinat/root_system/extended_affine_weyl_group.py +9 -9
- sage/combinat/root_system/fundamental_group.py +3 -5
- sage/combinat/root_system/hecke_algebra_representation.py +1 -1
- sage/combinat/root_system/integrable_representations.py +1 -1
- sage/combinat/root_system/pieri_factors.py +3 -3
- sage/combinat/root_system/root_lattice_realization_algebras.py +1 -1
- sage/combinat/root_system/root_lattice_realizations.py +1 -1
- sage/combinat/root_system/type_folded.py +3 -3
- sage/combinat/root_system/type_reducible.py +8 -7
- sage/combinat/root_system/type_super_A.py +2 -2
- sage/combinat/root_system/weight_lattice_realizations.py +9 -8
- sage/combinat/root_system/weyl_characters.py +2 -2
- sage/crypto/__init__.py +1 -0
- sage/crypto/block_cipher/des.py +1 -1
- sage/crypto/block_cipher/miniaes.py +3 -3
- sage/crypto/block_cipher/present.py +3 -3
- sage/crypto/block_cipher/sdes.py +3 -3
- sage/crypto/boolean_function.cpython-310-darwin.so +0 -0
- sage/crypto/boolean_function.pyx +22 -23
- sage/crypto/key_exchange/diffie_hellman.py +4 -9
- sage/crypto/mq/sr.py +1 -1
- sage/crypto/public_key/blum_goldwasser.py +3 -3
- sage/crypto/sbox.cpython-310-darwin.so +0 -0
- sage/crypto/sbox.pyx +1 -1
- sage/crypto/sboxes.py +22 -0
- sage/crypto/util.py +4 -6
- sage/ext/interpreters/__init__.py +1 -1
- sage/ext/interpreters/all__sagemath_modules.py +1 -1
- sage/ext/interpreters/wrapper_cc.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cc.pxd +5 -5
- sage/ext/interpreters/wrapper_cc.pyx +1 -1
- sage/ext/interpreters/wrapper_cdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cdf.pxd +5 -7
- sage/ext/interpreters/wrapper_cdf.pyx +4 -10
- sage/ext/interpreters/wrapper_rdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rdf.pxd +1 -1
- sage/ext/interpreters/wrapper_rdf.pyx +1 -1
- sage/ext/interpreters/wrapper_rr.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rr.pxd +5 -5
- sage/ext/interpreters/wrapper_rr.pyx +1 -2
- sage/geometry/toric_lattice.py +3 -3
- sage/geometry/toric_lattice_element.cpython-310-darwin.so +0 -0
- sage/groups/additive_abelian/additive_abelian_group.py +1 -1
- sage/groups/additive_abelian/qmodnz.py +4 -4
- sage/groups/matrix_gps/coxeter_group.py +17 -4
- sage/groups/matrix_gps/group_element.cpython-310-darwin.so +0 -0
- sage/groups/misc_gps/argument_groups.py +2 -2
- sage/groups/misc_gps/imaginary_groups.py +4 -4
- sage/groups/perm_gps/partn_ref/refinement_binary.cpython-310-darwin.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-310-darwin.so +0 -0
- sage/homology/chain_complex.py +0 -2
- sage/homology/hochschild_complex.py +3 -3
- sage/homology/homology_morphism.py +6 -6
- sage/homology/homology_vector_space_with_basis.py +1 -1
- sage/libs/gsl/array.cpython-310-darwin.so +0 -0
- sage/libs/mpmath/utils.cpython-310-darwin.so +0 -0
- sage/matrix/action.cpython-310-darwin.so +0 -0
- sage/matrix/args.cpython-310-darwin.so +0 -0
- sage/matrix/args.pyx +25 -10
- sage/matrix/benchmark.py +8 -4
- sage/matrix/compute_J_ideal.py +2 -2
- sage/matrix/constructor.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.pyx +1 -1
- sage/matrix/matrix0.cpython-310-darwin.so +0 -0
- sage/matrix/matrix0.pxd +3 -3
- sage/matrix/matrix0.pyx +7 -5
- sage/matrix/matrix1.cpython-310-darwin.so +0 -0
- sage/matrix/matrix1.pyx +87 -48
- sage/matrix/matrix2.cpython-310-darwin.so +0 -0
- sage/matrix/matrix2.pxd +3 -3
- sage/matrix/matrix2.pyx +1261 -63
- sage/matrix/matrix_cdv.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.pyx +1 -1
- sage/matrix/matrix_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_dense.pyx +2 -3
- sage/matrix/matrix_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_double_dense.pyx +11 -5
- sage/matrix/matrix_double_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.pyx +1 -1
- sage/matrix/matrix_laurent_mpolynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.pyx +952 -261
- sage/matrix/matrix_real_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.pyx +6 -7
- sage/matrix/matrix_window.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_window.pyx +2 -2
- sage/matrix/misc_mpfr.cpython-310-darwin.so +0 -0
- sage/matrix/operation_table.py +0 -2
- sage/matrix/special.py +5 -1
- sage/matrix/strassen.cpython-310-darwin.so +0 -0
- sage/matrix/strassen.pyx +1 -1
- sage/matroids/basis_exchange_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/basis_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/chow_ring.py +68 -65
- sage/matroids/chow_ring_ideal.py +41 -38
- sage/matroids/circuit_closures_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/circuits_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/database_matroids.py +16 -5
- sage/matroids/dual_matroid.py +2 -2
- sage/matroids/extension.cpython-310-darwin.so +0 -0
- sage/matroids/flats_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/gammoid.py +1 -1
- sage/matroids/graphic_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/graphic_matroid.pyx +3 -3
- sage/matroids/lean_matrix.cpython-310-darwin.so +0 -0
- sage/matroids/lean_matrix.pyx +22 -22
- sage/matroids/linear_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/linear_matroid.pyx +13 -13
- sage/matroids/matroid.cpython-310-darwin.so +0 -0
- sage/matroids/matroid.pyx +15 -15
- sage/matroids/matroids_plot_helpers.py +48 -46
- sage/matroids/minor_matroid.py +2 -2
- sage/matroids/set_system.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.pyx +3 -3
- sage/matroids/union_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/union_matroid.pyx +3 -0
- sage/matroids/unpickling.cpython-310-darwin.so +0 -0
- sage/matroids/utilities.py +2 -2
- sage/misc/c3.cpython-310-darwin.so +0 -0
- sage/misc/compat.py +1 -2
- sage/misc/pickle_old.cpython-310-darwin.so +0 -0
- sage/modules/diamond_cutting.py +117 -30
- sage/modules/fg_pid/fgp_module.py +3 -3
- sage/modules/filtered_vector_space.py +4 -4
- sage/modules/finite_submodule_iter.cpython-310-darwin.so +0 -0
- sage/modules/fp_graded/free_module.py +2 -2
- sage/modules/fp_graded/module.py +2 -2
- sage/modules/fp_graded/morphism.py +4 -4
- sage/modules/fp_graded/steenrod/morphism.py +1 -1
- sage/modules/free_module.py +162 -26
- sage/modules/free_module_element.cpython-310-darwin.so +0 -0
- sage/modules/free_module_element.pyx +4 -4
- sage/modules/free_module_integer.py +2 -2
- sage/modules/free_module_morphism.py +3 -3
- sage/modules/free_module_pseudohomspace.py +352 -0
- sage/modules/free_module_pseudomorphism.py +578 -0
- sage/modules/free_quadratic_module_integer_symmetric.py +24 -13
- sage/modules/matrix_morphism.py +9 -9
- sage/modules/multi_filtered_vector_space.py +4 -4
- sage/modules/ore_module.py +2208 -0
- sage/modules/ore_module_element.py +178 -0
- sage/modules/ore_module_homspace.py +147 -0
- sage/modules/ore_module_morphism.py +968 -0
- sage/modules/quotient_module.py +11 -1
- sage/modules/submodule.py +1 -1
- sage/modules/torsion_quadratic_module.py +1 -1
- sage/modules/vector_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.pyx +4 -4
- sage/modules/vector_modn_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_modn_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.pyx +1 -1
- sage/modules/vector_rational_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_sparse.pyx +5 -5
- sage/modules/vector_real_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_space_morphism.py +2 -2
- sage/modules/with_basis/cell_module.py +17 -0
- sage/modules/with_basis/indexed_element.cpython-310-darwin.so +0 -0
- sage/modules/with_basis/indexed_element.pyx +1 -1
- sage/modules/with_basis/invariant.py +1 -1
- sage/modules/with_basis/representation.py +0 -1
- sage/modules/with_basis/subquotient.py +2 -2
- sage/numerical/gauss_legendre.cpython-310-darwin.so +0 -0
- sage/probability/probability_distribution.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/binary_qf.py +11 -11
- sage/quadratic_forms/bqf_class_group.py +26 -92
- sage/quadratic_forms/count_local_2.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/extras.py +1 -1
- sage/quadratic_forms/quadratic_form.py +5 -4
- sage/quadratic_forms/quadratic_form__equivalence_testing.py +7 -4
- sage/quadratic_forms/quadratic_form__evaluate.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/quadratic_form__local_field_invariants.py +10 -10
- sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +2 -2
- sage/quadratic_forms/ternary.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/ternary_qf.py +50 -83
- sage/rings/cfinite_sequence.py +16 -17
- sage/rings/complex_conversion.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.pxd +1 -0
- sage/rings/complex_double.pyx +37 -32
- sage/rings/complex_mpc.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpc.pyx +27 -23
- sage/rings/complex_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpfr.pyx +11 -11
- sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +277 -21
- sage/rings/function_field/drinfeld_modules/drinfeld_module.py +10 -1
- sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1 -1
- sage/rings/function_field/drinfeld_modules/homset.py +1 -2
- sage/rings/function_field/drinfeld_modules/morphism.py +2 -2
- sage/rings/function_field/hermite_form_polynomial.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.pyx +27 -25
- sage/rings/invariants/invariant_theory.py +61 -60
- sage/rings/invariants/reconstruction.py +8 -8
- sage/rings/polynomial/laurent_polynomial_mpair.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_function_element.py +1 -1
- sage/rings/polynomial/ore_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_polynomial_element.pyx +8 -8
- sage/rings/polynomial/ore_polynomial_ring.py +134 -17
- sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pyx +3 -4
- sage/rings/polynomial/skew_polynomial_finite_order.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pyx +2 -5
- sage/rings/real_double_element_gsl.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.pyx +25 -7
- sage/rings/ring_extension.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension.pyx +4 -2
- sage/rings/ring_extension_conversion.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.pyx +42 -0
- sage/rings/ring_extension_morphism.cpython-310-darwin.so +0 -0
- sage/schemes/all__sagemath_modules.py +1 -0
- sage/schemes/projective/all__sagemath_modules.py +1 -0
- sage/schemes/projective/coherent_sheaf.py +300 -0
- sage/schemes/projective/cohomology.py +510 -0
- sage/stats/basic_stats.py +17 -15
- sage/stats/distributions/dgs_misc.h +11 -4
- sage/stats/distributions/discrete_gaussian_integer.cpython-310-darwin.so +0 -0
- sage/stats/distributions/discrete_gaussian_integer.pyx +9 -7
- sage/stats/hmm/chmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/chmm.pyx +13 -13
- sage/stats/hmm/distributions.cpython-310-darwin.so +0 -0
- sage/stats/hmm/distributions.pxd +3 -3
- sage/stats/hmm/distributions.pyx +3 -3
- sage/stats/hmm/hmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/hmm.pxd +3 -3
- sage/stats/hmm/hmm.pyx +6 -6
- sage/stats/hmm/util.cpython-310-darwin.so +0 -0
- sage/stats/hmm/util.pyx +6 -6
- sage/stats/intlist.cpython-310-darwin.so +0 -0
- sage/stats/intlist.pxd +3 -3
- sage/stats/time_series.cpython-310-darwin.so +0 -0
- sage/tensor/modules/alternating_contr_tensor.py +3 -3
- sage/tensor/modules/comp.py +3 -3
- sage/tensor/modules/ext_pow_free_module.py +3 -3
- sage/tensor/modules/format_utilities.py +3 -3
- sage/tensor/modules/free_module_linear_group.py +3 -3
- sage/tensor/modules/free_module_morphism.py +0 -1
- sage/tensor/modules/tensor_free_module.py +3 -3
- sage/tensor/modules/tensor_free_submodule.py +1 -1
- sage/tensor/modules/tensor_free_submodule_basis.py +1 -1
- sage/tensor/modules/tensor_with_indices.py +5 -5
- passagemath_modules.dylibs/libopenblas_armv8p-r0.3.28.dylib +0 -0
- {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# sage.doctest: needs sage.libs.gap
|
|
2
|
+
# sage.doctest: needs sage.graphs sage.libs.gap
|
|
3
3
|
r"""
|
|
4
|
-
Extended
|
|
4
|
+
Extended affine Weyl groups
|
|
5
5
|
|
|
6
6
|
AUTHORS:
|
|
7
7
|
|
|
@@ -1322,7 +1322,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
|
|
|
1322
1322
|
class ElementMethods:
|
|
1323
1323
|
|
|
1324
1324
|
@abstract_method
|
|
1325
|
-
def has_descent(self, i, side='right', positive=False):
|
|
1325
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
|
1326
1326
|
r"""
|
|
1327
1327
|
Return whether ``self`` * `s_i` < ``self`` where `s_i` is the `i`-th simple
|
|
1328
1328
|
reflection in the realized group.
|
|
@@ -1919,7 +1919,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
|
|
|
1919
1919
|
The element class for the "PW0" realization.
|
|
1920
1920
|
"""
|
|
1921
1921
|
|
|
1922
|
-
def has_descent(self, i, side='right', positive=False):
|
|
1922
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
|
1923
1923
|
r"""
|
|
1924
1924
|
Return whether ``self`` has `i` as a descent.
|
|
1925
1925
|
|
|
@@ -2129,7 +2129,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
|
|
|
2129
2129
|
The element class for the W0P realization.
|
|
2130
2130
|
"""
|
|
2131
2131
|
|
|
2132
|
-
def has_descent(self, i, side='right', positive=False):
|
|
2132
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
|
2133
2133
|
r"""
|
|
2134
2134
|
Return whether ``self`` has `i` as a descent.
|
|
2135
2135
|
|
|
@@ -2308,7 +2308,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
|
|
|
2308
2308
|
Element class for the "WF" realization.
|
|
2309
2309
|
"""
|
|
2310
2310
|
|
|
2311
|
-
def has_descent(self, i, side='right', positive=False):
|
|
2311
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
|
2312
2312
|
r"""
|
|
2313
2313
|
Return whether ``self`` has `i` as a descent.
|
|
2314
2314
|
|
|
@@ -2482,7 +2482,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
|
|
|
2482
2482
|
The element class for the "FW" realization.
|
|
2483
2483
|
"""
|
|
2484
2484
|
|
|
2485
|
-
def has_descent(self, i, side='right', positive=False):
|
|
2485
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
|
2486
2486
|
r"""
|
|
2487
2487
|
Return whether ``self`` has descent at `i`.
|
|
2488
2488
|
|
|
@@ -2642,7 +2642,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
|
|
|
2642
2642
|
The element class for the "PvW0" realization.
|
|
2643
2643
|
"""
|
|
2644
2644
|
|
|
2645
|
-
def has_descent(self, i, side='right', positive=False):
|
|
2645
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
|
2646
2646
|
r"""
|
|
2647
2647
|
Return whether ``self`` has `i` as a descent.
|
|
2648
2648
|
|
|
@@ -2837,7 +2837,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
|
|
|
2837
2837
|
assert la in w.parent().domain()
|
|
2838
2838
|
return w.action(self.cartesian_projection(1).value + la)
|
|
2839
2839
|
|
|
2840
|
-
def has_descent(self, i, side='right', positive=False):
|
|
2840
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
|
2841
2841
|
r"""
|
|
2842
2842
|
Return whether ``self`` has `i` as a descent.
|
|
2843
2843
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
2
|
# sage.doctest: needs sage.graphs sage.groups
|
|
3
3
|
r"""
|
|
4
|
-
Fundamental
|
|
4
|
+
Fundamental group of an extended affine Weyl group
|
|
5
5
|
|
|
6
6
|
AUTHORS:
|
|
7
7
|
|
|
@@ -532,8 +532,7 @@ class FundamentalGroupOfExtendedAffineWeylGroup_Class(UniqueRepresentation,
|
|
|
532
532
|
"""
|
|
533
533
|
return iter(self.group_generators())
|
|
534
534
|
|
|
535
|
-
|
|
536
|
-
def an_element(self):
|
|
535
|
+
def _an_element_(self):
|
|
537
536
|
r"""
|
|
538
537
|
Return an element of ``self``.
|
|
539
538
|
|
|
@@ -708,8 +707,7 @@ class FundamentalGroupGL(FundamentalGroupOfExtendedAffineWeylGroup_Class):
|
|
|
708
707
|
"""
|
|
709
708
|
return LazyFamily(ZZ, lambda i: i)
|
|
710
709
|
|
|
711
|
-
|
|
712
|
-
def an_element(self):
|
|
710
|
+
def _an_element_(self):
|
|
713
711
|
r"""
|
|
714
712
|
An element of ``self``.
|
|
715
713
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
2
|
# sage.doctest: needs sage.graphs sage.modules
|
|
3
3
|
"""
|
|
4
|
-
Integrable
|
|
4
|
+
Integrable representations of affine Lie algebras
|
|
5
5
|
"""
|
|
6
6
|
# ***************************************************************************
|
|
7
7
|
# Copyright (C) 2014, 2105 Daniel Bump <bump at match.stanford.edu>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# sage.doctest: needs sage.libs.gap
|
|
2
|
+
# sage.doctest: needs sage.graphs sage.libs.gap
|
|
3
3
|
r"""
|
|
4
|
-
Pieri
|
|
4
|
+
Pieri factors
|
|
5
5
|
"""
|
|
6
6
|
# ****************************************************************************
|
|
7
7
|
# Copyright (C) 2009-2010 Steven Pon <spon at math.ucdavis.edu>
|
|
@@ -520,7 +520,7 @@ class PieriFactors_type_A_affine(PieriFactors_affine_type):
|
|
|
520
520
|
|
|
521
521
|
@staticmethod
|
|
522
522
|
def __classcall__(cls, W, min_length=0, max_length=infinity,
|
|
523
|
-
min_support=frozenset(
|
|
523
|
+
min_support=frozenset(), max_support=None):
|
|
524
524
|
r"""
|
|
525
525
|
TESTS::
|
|
526
526
|
|
|
@@ -65,7 +65,7 @@ class Algebras(AlgebrasCategory):
|
|
|
65
65
|
|
|
66
66
|
sage: A = RootSystem(["B",2]).weight_space().algebra(QQ)
|
|
67
67
|
sage: A.some_elements()
|
|
68
|
-
[B[2*Lambda[1] + 2*Lambda[2]], ...
|
|
68
|
+
[B[2*Lambda[1] + 2*Lambda[2]], ...B[Lambda[1]], B[Lambda[2]]]
|
|
69
69
|
sage: A.some_elements() # needs sage.graphs
|
|
70
70
|
[B[2*Lambda[1] + 2*Lambda[2]],
|
|
71
71
|
B[2*Lambda[1] - 2*Lambda[2]],
|
|
@@ -3645,7 +3645,7 @@ class RootLatticeRealizations(Category_over_base_ring):
|
|
|
3645
3645
|
# Descents
|
|
3646
3646
|
##########################################################################
|
|
3647
3647
|
|
|
3648
|
-
def has_descent(self, i, positive=False):
|
|
3648
|
+
def has_descent(self, i, positive=False) -> bool:
|
|
3649
3649
|
"""
|
|
3650
3650
|
Test if ``self`` has a descent at position `i`, that is, if ``self`` is
|
|
3651
3651
|
on the strict negative side of the `i`-th simple reflection
|
|
@@ -293,9 +293,9 @@ class CartanTypeFolded(UniqueRepresentation, SageObject):
|
|
|
293
293
|
return root.leading_coefficient() / coroot.leading_coefficient()
|
|
294
294
|
index_set = self._cartan_type.index_set()
|
|
295
295
|
min_f = min(f(j) for j in index_set)
|
|
296
|
-
return Family(
|
|
296
|
+
return Family({i: int(f(i) / min_f) for i in index_set})
|
|
297
297
|
elif self._cartan_type.is_affine():
|
|
298
298
|
c = self._cartan_type.translation_factors()
|
|
299
299
|
cmax = max(c)
|
|
300
|
-
return Family(
|
|
301
|
-
|
|
300
|
+
return Family({i: int(cmax / c[i])
|
|
301
|
+
for i in self._cartan_type.index_set()})
|
|
@@ -117,11 +117,12 @@ class CartanType(SageObject, CartanType_abstract):
|
|
|
117
117
|
"""
|
|
118
118
|
self._types = types
|
|
119
119
|
self.affine = False
|
|
120
|
-
indices = (None,) + tuple(
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
indices = (None,) + tuple((i, j)
|
|
121
|
+
for i in range(len(types))
|
|
122
|
+
for j in types[i].index_set())
|
|
123
123
|
self._indices = indices
|
|
124
|
-
self._index_relabelling =
|
|
124
|
+
self._index_relabelling = {indices[i]: i
|
|
125
|
+
for i in range(1, len(indices))}
|
|
125
126
|
|
|
126
127
|
self._spaces = [t.root_system().ambient_space() for t in types]
|
|
127
128
|
if all(l is not None for l in self._spaces):
|
|
@@ -131,9 +132,9 @@ class CartanType(SageObject, CartanType_abstract):
|
|
|
131
132
|
self.tools = root_system.type_reducible
|
|
132
133
|
# a direct product of finite Cartan types is again finite;
|
|
133
134
|
# idem for simply laced and crystallographic.
|
|
134
|
-
super_classes = tuple(
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
super_classes = tuple(cls
|
|
136
|
+
for cls in (CartanType_finite, CartanType_simply_laced, CartanType_crystallographic)
|
|
137
|
+
if all(isinstance(t, cls) for t in types))
|
|
137
138
|
self._add_abstract_superclass(super_classes)
|
|
138
139
|
|
|
139
140
|
def _repr_(self, compact=True): # We should make a consistent choice here
|
|
@@ -376,7 +376,7 @@ class AmbientSpace(ambient_space.AmbientSpace):
|
|
|
376
376
|
I = P.index_set()
|
|
377
377
|
return P.sum((-c/dep[0]) * h[I[i]] for i,c in dep[1:].items())
|
|
378
378
|
|
|
379
|
-
def has_descent(self, i, positive=False):
|
|
379
|
+
def has_descent(self, i, positive=False) -> bool:
|
|
380
380
|
"""
|
|
381
381
|
Test if ``self`` has a descent at position `i`, that is
|
|
382
382
|
if ``self`` is on the strict negative side of the `i`-th
|
|
@@ -415,7 +415,7 @@ class AmbientSpace(ambient_space.AmbientSpace):
|
|
|
415
415
|
else:
|
|
416
416
|
return s < 0
|
|
417
417
|
|
|
418
|
-
def is_dominant_weight(self):
|
|
418
|
+
def is_dominant_weight(self) -> bool:
|
|
419
419
|
"""
|
|
420
420
|
Test whether ``self`` is a dominant element of the weight lattice.
|
|
421
421
|
|
|
@@ -480,7 +480,7 @@ class WeightLatticeRealizations(Category_over_base_ring):
|
|
|
480
480
|
sage: R.reduced_word_of_alcove_morphism(omega3.translation)
|
|
481
481
|
[0, 1, 0, 2, 1, 0]
|
|
482
482
|
|
|
483
|
-
sage: # needs sage.libs.gap
|
|
483
|
+
sage: # needs sage.graphs sage.libs.gap
|
|
484
484
|
sage: W = WeylGroup(['C',3,1])
|
|
485
485
|
sage: s = W.simple_reflections()
|
|
486
486
|
sage: w = s[0]*s[1]*s[2]*s[3]*s[2]
|
|
@@ -597,10 +597,10 @@ class WeightLatticeRealizations(Category_over_base_ring):
|
|
|
597
597
|
# Now, we have d = f w^-1
|
|
598
598
|
winv = ~w
|
|
599
599
|
assert all(alpha[i].level().is_zero() for i in self.index_set())
|
|
600
|
-
rank_simple_roots =
|
|
600
|
+
rank_simple_roots = {alpha[i]: i for i in self.index_set()}
|
|
601
601
|
permutation = dict()
|
|
602
602
|
for i in self.index_set():
|
|
603
|
-
root = f(winv.action(alpha[i]))
|
|
603
|
+
root = f(winv.action(alpha[i])) # This is d(alpha_i)
|
|
604
604
|
assert root in rank_simple_roots
|
|
605
605
|
permutation[i] = rank_simple_roots[root]
|
|
606
606
|
assert set(permutation.values()), set(self.index_set())
|
|
@@ -695,7 +695,8 @@ class WeightLatticeRealizations(Category_over_base_ring):
|
|
|
695
695
|
# preserving the alcoves.
|
|
696
696
|
if elements is None:
|
|
697
697
|
c = self.cartan_type().c()
|
|
698
|
-
elements = [
|
|
698
|
+
elements = [c[i] * Lambda[i]
|
|
699
|
+
for i in self.cartan_type().classical().index_set()]
|
|
699
700
|
|
|
700
701
|
# When the null root is zero in this root lattice realization,
|
|
701
702
|
# the roots correspond to the classical roots. We use that to
|
|
@@ -704,7 +705,7 @@ class WeightLatticeRealizations(Category_over_base_ring):
|
|
|
704
705
|
# set to be of the form 0..n
|
|
705
706
|
test_automorphism = self.null_root().is_zero() and set(self.index_set()) == set(i for i in range(len(self.index_set())))
|
|
706
707
|
# dictionary assigning a simple root to its index
|
|
707
|
-
rank_simple_roots =
|
|
708
|
+
rank_simple_roots = {alpha[i]: i for i in self.index_set()}
|
|
708
709
|
|
|
709
710
|
try:
|
|
710
711
|
W = self.weyl_group()
|
|
@@ -779,15 +780,15 @@ class WeightLatticeRealizations(Category_over_base_ring):
|
|
|
779
780
|
EXAMPLES::
|
|
780
781
|
|
|
781
782
|
sage: L = RootSystem(['C',2,1]).weight_lattice()
|
|
782
|
-
sage: L.signs_of_alcovewalk([1,2,0,1,2,1,2,0,1,2]) # needs sage.libs.gap
|
|
783
|
+
sage: L.signs_of_alcovewalk([1,2,0,1,2,1,2,0,1,2]) # needs sage.graphs sage.libs.gap
|
|
783
784
|
[-1, -1, 1, -1, 1, 1, 1, 1, 1, 1]
|
|
784
785
|
|
|
785
786
|
sage: L = RootSystem(['A',2,1]).weight_lattice()
|
|
786
|
-
sage: L.signs_of_alcovewalk([0,1,2,1,2,0,1,2,0,1,2,0]) # needs sage.libs.gap
|
|
787
|
+
sage: L.signs_of_alcovewalk([0,1,2,1,2,0,1,2,0,1,2,0]) # needs sage.graphs sage.libs.gap
|
|
787
788
|
[1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1]
|
|
788
789
|
|
|
789
790
|
sage: L = RootSystem(['B',2,1]).coweight_lattice()
|
|
790
|
-
sage: L.signs_of_alcovewalk([0,1,2,0,1,2]) # needs sage.libs.gap
|
|
791
|
+
sage: L.signs_of_alcovewalk([0,1,2,0,1,2]) # needs sage.graphs sage.libs.gap
|
|
791
792
|
[1, -1, 1, -1, 1, 1]
|
|
792
793
|
|
|
793
794
|
.. WARNING::
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
2
|
# sage.doctest: needs sage.graphs sage.groups sage.modules
|
|
3
3
|
"""
|
|
4
|
-
Weyl
|
|
4
|
+
Weyl character rings
|
|
5
5
|
"""
|
|
6
6
|
# ****************************************************************************
|
|
7
7
|
# Copyright (C) 2011 Daniel Bump <bump at match.stanford.edu>
|
|
@@ -91,7 +91,7 @@ class WeylCharacterRing(CombinatorialFreeModule):
|
|
|
91
91
|
For more information, see the thematic tutorial *Lie Methods and
|
|
92
92
|
Related Combinatorics in Sage*, available at:
|
|
93
93
|
|
|
94
|
-
https://
|
|
94
|
+
https://passagemath.org/docs/latest/html/en/thematic_tutorials/lie.html
|
|
95
95
|
"""
|
|
96
96
|
@staticmethod
|
|
97
97
|
def __classcall__(cls, ct, base_ring=ZZ, prefix=None, style='lattice', k=None, conjugate=False, cyclotomic_order=None, fusion_labels=None, inject_variables=False):
|
sage/crypto/__init__.py
CHANGED
sage/crypto/block_cipher/des.py
CHANGED
|
@@ -1042,7 +1042,7 @@ def convert_to_vector(I, L):
|
|
|
1042
1042
|
|
|
1043
1043
|
- ``I`` -- integer or bit list-like
|
|
1044
1044
|
|
|
1045
|
-
- ``L`` -- integer; the desired bit length of the
|
|
1045
|
+
- ``L`` -- integer; the desired bit length of the output
|
|
1046
1046
|
|
|
1047
1047
|
OUTPUT: the ``L``-bit vector representation of ``I``
|
|
1048
1048
|
|
|
@@ -12,7 +12,7 @@ AUTHORS:
|
|
|
12
12
|
- Minh Van Nguyen (2009-05): initial version
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# #########################################################################
|
|
16
16
|
# Copyright (c) 2009 Minh Van Nguyen <nguyenminh2@gmail.com>
|
|
17
17
|
#
|
|
18
18
|
# This program is free software; you can redistribute it and/or modify
|
|
@@ -25,8 +25,8 @@ AUTHORS:
|
|
|
25
25
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
26
26
|
# GNU General Public License for more details.
|
|
27
27
|
#
|
|
28
|
-
#
|
|
29
|
-
|
|
28
|
+
# https://www.gnu.org/licenses/
|
|
29
|
+
# #########################################################################
|
|
30
30
|
|
|
31
31
|
from sage.matrix.matrix_dense import Matrix_dense
|
|
32
32
|
from sage.matrix.matrix_space import MatrixSpace
|
|
@@ -554,7 +554,7 @@ class PRESENT(SageObject):
|
|
|
554
554
|
:mod:`sage.crypto.sbox` uses big endian by default whereas most of
|
|
555
555
|
Sage uses little endian. So to use the big endian PRESENT Sbox from
|
|
556
556
|
:mod:`sage.crypto.sboxes` :func:`sbox_layer` has to do some endian
|
|
557
|
-
conversion (i.e. reverse input and
|
|
557
|
+
conversion (i.e. reverse input and output of the Sbox). Keep this in
|
|
558
558
|
mind if you change the Sbox or :func:`sbox_layer`.
|
|
559
559
|
"""
|
|
560
560
|
sbox = self.sbox if not inverse else self.sbox.inverse()
|
|
@@ -704,7 +704,7 @@ class PRESENT_KS(SageObject):
|
|
|
704
704
|
:mod:`sage.crypto.sbox` uses big endian by default whereas most of Sage
|
|
705
705
|
uses little endian. So to use the big endian PRESENT Sbox from
|
|
706
706
|
:mod:`sage.crypto.sboxes` :class:`PRESENT_KS` has to do some endian
|
|
707
|
-
conversion (i.e. reverse input and
|
|
707
|
+
conversion (i.e. reverse input and output of the Sbox). Keep this in
|
|
708
708
|
mind if you change the Sbox or :func:`__call__`.
|
|
709
709
|
|
|
710
710
|
.. automethod:: __init__
|
|
@@ -886,7 +886,7 @@ def convert_to_vector(I, L):
|
|
|
886
886
|
|
|
887
887
|
- ``I`` -- integer or bit list-like
|
|
888
888
|
|
|
889
|
-
- ``L`` -- integer; the desired bit length of the
|
|
889
|
+
- ``L`` -- integer; the desired bit length of the output
|
|
890
890
|
|
|
891
891
|
OUTPUT: the ``L``-bit vector representation of ``I``
|
|
892
892
|
|
sage/crypto/block_cipher/sdes.py
CHANGED
|
@@ -13,7 +13,7 @@ AUTHORS:
|
|
|
13
13
|
- Minh Van Nguyen (2009-06): initial version
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
# #########################################################################
|
|
17
17
|
# Copyright (c) 2009 Minh Van Nguyen <nguyenminh2@gmail.com>
|
|
18
18
|
#
|
|
19
19
|
# This program is free software; you can redistribute it and/or modify
|
|
@@ -26,8 +26,8 @@ AUTHORS:
|
|
|
26
26
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
27
27
|
# GNU General Public License for more details.
|
|
28
28
|
#
|
|
29
|
-
#
|
|
30
|
-
|
|
29
|
+
# https://www.gnu.org/licenses/
|
|
30
|
+
# #########################################################################
|
|
31
31
|
|
|
32
32
|
from sage.monoids.string_monoid import BinaryStrings
|
|
33
33
|
from sage.structure.sage_object import SageObject
|
|
Binary file
|
sage/crypto/boolean_function.pyx
CHANGED
|
@@ -101,7 +101,7 @@ cdef long yellow_code(unsigned long a) noexcept:
|
|
|
101
101
|
cdef unsigned long s = (8*sizeof(unsigned long)) >> 1
|
|
102
102
|
cdef unsigned long m = (~0UL) >> s
|
|
103
103
|
cdef unsigned long r = a
|
|
104
|
-
while
|
|
104
|
+
while s:
|
|
105
105
|
sig_check()
|
|
106
106
|
r ^= (r&m) << s
|
|
107
107
|
s >>= 1
|
|
@@ -289,11 +289,11 @@ cdef class BooleanFunction(SageObject):
|
|
|
289
289
|
if isinstance(x, str):
|
|
290
290
|
L = ZZ(len(x))
|
|
291
291
|
if L.is_power_of(2):
|
|
292
|
-
x = ZZ("0x"+x).digits(base=2,padto=4*L)
|
|
292
|
+
x = ZZ("0x" + x).digits(base=2, padto=4*L)
|
|
293
293
|
else:
|
|
294
294
|
raise ValueError("the length of the truth table must be a power of 2")
|
|
295
295
|
from types import GeneratorType
|
|
296
|
-
if isinstance(x, (list,tuple,GeneratorType)):
|
|
296
|
+
if isinstance(x, (list, tuple, GeneratorType)):
|
|
297
297
|
# initialisation from a truth table
|
|
298
298
|
|
|
299
299
|
# first, check the length
|
|
@@ -337,14 +337,15 @@ cdef class BooleanFunction(SageObject):
|
|
|
337
337
|
FiniteField_givaro = ()
|
|
338
338
|
if isinstance(K, FiniteField_givaro): # the ordering is not the same in this case
|
|
339
339
|
for u in K:
|
|
340
|
-
bitset_set_to(self._truth_table,
|
|
340
|
+
bitset_set_to(self._truth_table,
|
|
341
|
+
ZZ(u._vector_().list(), 2), (x(u)).trace())
|
|
341
342
|
else:
|
|
342
|
-
for i,u in enumerate(K):
|
|
343
|
+
for i, u in enumerate(K):
|
|
343
344
|
bitset_set_to(self._truth_table, i, (x(u)).trace())
|
|
344
345
|
elif isinstance(x, BooleanFunction):
|
|
345
346
|
self._nvariables = x.nvariables()
|
|
346
347
|
bitset_init(self._truth_table, <mp_bitcnt_t> (1<<self._nvariables))
|
|
347
|
-
bitset_copy(self._truth_table,(<BooleanFunction>x)._truth_table)
|
|
348
|
+
bitset_copy(self._truth_table, (<BooleanFunction>x)._truth_table)
|
|
348
349
|
else:
|
|
349
350
|
raise TypeError("unable to init the Boolean function")
|
|
350
351
|
|
|
@@ -508,7 +509,7 @@ cdef class BooleanFunction(SageObject):
|
|
|
508
509
|
bitset_copy(anf, self._truth_table)
|
|
509
510
|
reed_muller(anf.bits, ZZ(anf.limbs).exact_log(2))
|
|
510
511
|
from sage.rings.polynomial.pbori.pbori import BooleanPolynomialRing
|
|
511
|
-
R = BooleanPolynomialRing(self._nvariables,"x")
|
|
512
|
+
R = BooleanPolynomialRing(self._nvariables, "x")
|
|
512
513
|
G = R.gens()
|
|
513
514
|
P = R(0)
|
|
514
515
|
|
|
@@ -518,7 +519,7 @@ cdef class BooleanFunction(SageObject):
|
|
|
518
519
|
inf = i*sizeof(long)*8
|
|
519
520
|
sup = min((i+1)*sizeof(long)*8, (1<<self._nvariables))
|
|
520
521
|
for j in range(inf, sup):
|
|
521
|
-
if bitset_in(anf,j):
|
|
522
|
+
if bitset_in(anf, j):
|
|
522
523
|
m = R(1)
|
|
523
524
|
for k in range(self._nvariables):
|
|
524
525
|
if (j>>k)&1:
|
|
@@ -593,9 +594,9 @@ cdef class BooleanFunction(SageObject):
|
|
|
593
594
|
if format == 'bin':
|
|
594
595
|
return tuple(self)
|
|
595
596
|
if format == 'int':
|
|
596
|
-
return tuple(map(int,self))
|
|
597
|
+
return tuple(map(int, self))
|
|
597
598
|
if format == 'hex':
|
|
598
|
-
S = ZZ(self.truth_table(),2).str(16)
|
|
599
|
+
S = ZZ(self.truth_table(), 2).str(16)
|
|
599
600
|
S = "0"*((1<<(self._nvariables-2)) - len(S)) + S
|
|
600
601
|
return S
|
|
601
602
|
raise ValueError("unknown output format")
|
|
@@ -714,7 +715,7 @@ cdef class BooleanFunction(SageObject):
|
|
|
714
715
|
(0, -4, 0, 4, 0, 4, 0, 4)
|
|
715
716
|
"""
|
|
716
717
|
cdef long *temp
|
|
717
|
-
cdef mp_bitcnt_t i,n
|
|
718
|
+
cdef mp_bitcnt_t i, n
|
|
718
719
|
|
|
719
720
|
if self._walsh_hadamard_transform is None:
|
|
720
721
|
n = self._truth_table.size
|
|
@@ -1011,7 +1012,7 @@ cdef class BooleanFunction(SageObject):
|
|
|
1011
1012
|
"""
|
|
1012
1013
|
# NOTE: this is a toy implementation
|
|
1013
1014
|
from sage.rings.polynomial.polynomial_ring_constructor import BooleanPolynomialRing_constructor
|
|
1014
|
-
R = BooleanPolynomialRing_constructor(self._nvariables,'x')
|
|
1015
|
+
R = BooleanPolynomialRing_constructor(self._nvariables, 'x')
|
|
1015
1016
|
G = R.gens()
|
|
1016
1017
|
r = [R(1)]
|
|
1017
1018
|
|
|
@@ -1023,7 +1024,8 @@ cdef class BooleanFunction(SageObject):
|
|
|
1023
1024
|
|
|
1024
1025
|
from sage.matrix.constructor import Matrix
|
|
1025
1026
|
from sage.arith.misc import binomial
|
|
1026
|
-
M = Matrix(GF(2), sum(binomial(self._nvariables,
|
|
1027
|
+
M = Matrix(GF(2), sum(binomial(self._nvariables, i)
|
|
1028
|
+
for i in range(d+1)), len(s))
|
|
1027
1029
|
|
|
1028
1030
|
cdef long i
|
|
1029
1031
|
for i in range(1, d+1):
|
|
@@ -1037,23 +1039,20 @@ cdef class BooleanFunction(SageObject):
|
|
|
1037
1039
|
cdef long j
|
|
1038
1040
|
cdef mp_bitcnt_t v
|
|
1039
1041
|
|
|
1040
|
-
for i,m in enumerate(r):
|
|
1042
|
+
for i, m in enumerate(r):
|
|
1041
1043
|
t = BooleanFunction(m)
|
|
1042
|
-
for j,v in enumerate(s):
|
|
1044
|
+
for j, v in enumerate(s):
|
|
1043
1045
|
sig_check()
|
|
1044
|
-
M[i,j] = bitset_in(t._truth_table,v)
|
|
1046
|
+
M[i, j] = bitset_in(t._truth_table, v)
|
|
1045
1047
|
|
|
1046
1048
|
kg = M.kernel().gens()
|
|
1047
1049
|
|
|
1048
1050
|
if kg:
|
|
1049
|
-
res = sum([kg[0][i]*ri for i,ri in enumerate(r)])
|
|
1051
|
+
res = sum([kg[0][i]*ri for i, ri in enumerate(r)])
|
|
1050
1052
|
else:
|
|
1051
1053
|
res = None
|
|
1052
1054
|
|
|
1053
|
-
if dim
|
|
1054
|
-
return res, len(kg)
|
|
1055
|
-
else:
|
|
1056
|
-
return res
|
|
1055
|
+
return (res, len(kg)) if dim else res
|
|
1057
1056
|
|
|
1058
1057
|
def algebraic_immunity(self, annihilator=False):
|
|
1059
1058
|
"""
|
|
@@ -1211,7 +1210,7 @@ cdef class BooleanFunction(SageObject):
|
|
|
1211
1210
|
except TypeError:
|
|
1212
1211
|
raise TypeError("cannot compute is_linear_structure() using parameter %s" % (val,))
|
|
1213
1212
|
|
|
1214
|
-
def has_linear_structure(self):
|
|
1213
|
+
def has_linear_structure(self) -> bool:
|
|
1215
1214
|
r"""
|
|
1216
1215
|
Return ``True`` if this function has a linear structure.
|
|
1217
1216
|
|
|
@@ -1484,5 +1483,5 @@ def random_boolean_function(n):
|
|
|
1484
1483
|
T[0] = B._truth_table[0]
|
|
1485
1484
|
for i in range(T.limbs):
|
|
1486
1485
|
sig_check()
|
|
1487
|
-
T.bits[i] = r.randrange(0,Integer(1)<<(sizeof(unsigned long)*8))
|
|
1486
|
+
T.bits[i] = r.randrange(0, Integer(1)<<(sizeof(unsigned long)*8))
|
|
1488
1487
|
return B
|
|
@@ -18,22 +18,17 @@ AUTHORS:
|
|
|
18
18
|
# (at your option) any later version.
|
|
19
19
|
# https://www.gnu.org/licenses/
|
|
20
20
|
# ****************************************************************************
|
|
21
|
-
|
|
22
|
-
from sage.misc.superseded import experimental
|
|
21
|
+
from typing import Union
|
|
23
22
|
|
|
24
23
|
from sage.crypto.key_exchange.key_exchange_scheme import KeyExchangeScheme
|
|
25
|
-
|
|
26
|
-
from sage.arith.misc import is_prime
|
|
27
24
|
from sage.misc.prandom import randint
|
|
28
|
-
from sage.
|
|
25
|
+
from sage.misc.superseded import experimental
|
|
29
26
|
from sage.rings.finite_rings.finite_field_constructor import GF
|
|
30
|
-
from sage.rings.finite_rings.finite_field_prime_modn import
|
|
31
|
-
FiniteField_prime_modn
|
|
27
|
+
from sage.rings.finite_rings.finite_field_prime_modn import FiniteField_prime_modn
|
|
32
28
|
from sage.rings.finite_rings.integer_mod import IntegerMod_abstract
|
|
29
|
+
from sage.rings.integer import Integer
|
|
33
30
|
from sage.structure.proof.proof import WithProof
|
|
34
31
|
|
|
35
|
-
from typing import Union
|
|
36
|
-
|
|
37
32
|
|
|
38
33
|
class DiffieHellman(KeyExchangeScheme):
|
|
39
34
|
|
sage/crypto/mq/sr.py
CHANGED
|
@@ -463,7 +463,7 @@ class SR_generic(MPolynomialSystemGenerator):
|
|
|
463
463
|
self._reverse_variables = bool(kwargs.get("reverse_variables", True))
|
|
464
464
|
|
|
465
465
|
with AllowZeroInversionsContext(self):
|
|
466
|
-
sub_byte_lookup =
|
|
466
|
+
sub_byte_lookup = {v: self.sub_byte(v) for v in self._base}
|
|
467
467
|
self._sub_byte_lookup = sub_byte_lookup
|
|
468
468
|
|
|
469
469
|
if self._gf2:
|
|
@@ -18,7 +18,7 @@ AUTHORS:
|
|
|
18
18
|
the description contained in [MvOV1996]_.
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
# ****************************************************************************
|
|
22
22
|
# Copyright (c) 2009, 2010 Mike Hogan
|
|
23
23
|
# Copyright (c) 2009, 2010 David Joyner <wdjoyner@gmail.com>
|
|
24
24
|
# Copyright (c) 2009, 2010 Minh Van Nguyen <nguyenminh2@gmail.com>
|
|
@@ -27,8 +27,8 @@ AUTHORS:
|
|
|
27
27
|
# it under the terms of the GNU General Public License as published by
|
|
28
28
|
# the Free Software Foundation, either version 2 of the License, or
|
|
29
29
|
# (at your option) any later version.
|
|
30
|
-
#
|
|
31
|
-
|
|
30
|
+
# https://www.gnu.org/licenses/
|
|
31
|
+
# ****************************************************************************
|
|
32
32
|
|
|
33
33
|
from operator import xor
|
|
34
34
|
|
|
Binary file
|
sage/crypto/sbox.pyx
CHANGED
|
@@ -1647,7 +1647,7 @@ cdef class SBox(SageObject):
|
|
|
1647
1647
|
ret.append((j, i, c))
|
|
1648
1648
|
return ret
|
|
1649
1649
|
|
|
1650
|
-
def has_linear_structure(self):
|
|
1650
|
+
def has_linear_structure(self) -> bool:
|
|
1651
1651
|
"""
|
|
1652
1652
|
Return ``True`` if there exists a nonzero component function of this
|
|
1653
1653
|
S-Box that has a linear structure.
|
sage/crypto/sboxes.py
CHANGED
|
@@ -400,6 +400,28 @@ def monomial_function(n, e):
|
|
|
400
400
|
return SBox(X**e)
|
|
401
401
|
|
|
402
402
|
|
|
403
|
+
def inversion(n):
|
|
404
|
+
r"""
|
|
405
|
+
Return the S-Box constructed from the inversion mapping over `\GF{2^n}`
|
|
406
|
+
extending `0 \mapsto 0`.
|
|
407
|
+
|
|
408
|
+
INPUT:
|
|
409
|
+
|
|
410
|
+
- ``n`` -- size of the S-Box
|
|
411
|
+
|
|
412
|
+
EXAMPLES::
|
|
413
|
+
|
|
414
|
+
sage: from sage.crypto.sboxes import inversion
|
|
415
|
+
sage: S4 = inversion(4)
|
|
416
|
+
sage: S4.differential_uniformity()
|
|
417
|
+
4
|
|
418
|
+
sage: S5 = inversion(5)
|
|
419
|
+
sage: S5.differential_uniformity()
|
|
420
|
+
2
|
|
421
|
+
"""
|
|
422
|
+
return monomial_function(n, 2**n - 2)
|
|
423
|
+
|
|
424
|
+
|
|
403
425
|
def chi(n):
|
|
404
426
|
r"""
|
|
405
427
|
Return the `\chi` function defined over `\GF{2^n}` used in the nonlinear
|