hilbert

class cryptographic_estimators.MQEstimator.series.hilbert.HilbertSeries(n: int, degrees: list[int], q=None)

Bases: object

Construct an instance of Hilbert series.

Parameters:
  • n (int) – The number of variables.

  • degrees (list[int]) – A list of integers representing the degree of the polynomials.

  • q (int, optional) – The order of the finite field. Defaults to None.

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(10, [2]*15)
>>> H
Hilbert series for system with 10 variables and 15 polynomials
>>> H = HilbertSeries(10, [2]*15, q=2)
>>> H
Hilbert series for system with 10 variables and 15 polynomials over F_2
coefficient_of_degree(d: int)

Return the d-th coefficient in the Hilbert serie self._series.

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(4, [2]*5)
>>> H.coefficient_of_degree(5)
-4
coefficient_up_to_degree(d: int)

Return the d-th coefficient in the Hilbert serie self._series/(1-x)

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(4, [2]*5)
>>> H.coefficient_up_to_degree(4)
5
property degrees

Return a list of degrees of the polynomials.

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(5, [2]*7)
>>> H.degrees
[2, 2, 2, 2, 2, 2, 2]
first_nonpositive_coefficient()

Return the first non-positive integer of the series.

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(10, [2]*15)
>>> H.first_nonpositive_coefficient()
4
first_nonpositive_coefficient_up_to_degree()

Return the first non-positive integer of the serie self._series/(1-x).

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(10, [2]*15)
>>> H.first_nonpositive_coefficient_up_to_degree()
5
property npolynomials

Return the number of polynomials.

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(10, [2]*15)
>>> H.npolynomials
15
property nvariables

Return the number of variables.

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(5, [2]*7)
>>> H.nvariables
5
property precision

Return the precision of the series.

Examples

>>> from cryptographic_estimators.MQEstimator.series.hilbert import HilbertSeries
>>> H = HilbertSeries(5, [3]*7)
>>> H.precision
14