API Reference

Class for computing algebraic immunity.

This class does not store any state. Use its static methods to compute algebraic immunity directly from a truth table.

__doc__ = 'Class for computing algebraic immunity.\n\nThis class does not store any state. Use its static methods to compute\nalgebraic immunity directly from a truth table.' class-attribute

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__module__ = 'algebraic_immunity.algebraic_immunity' class-attribute

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__new__(*args, **kwargs) builtin

Create and return a new object. See help(type) for accurate signature.

ai(truth_table, n) staticmethod

Compute the algebraic immunity of a Boolean function.

Parameters:
  • truth_table

    Truth table of the Boolean function. Each entry must be either 0 or 1.

  • n

    Number of variables of the Boolean function.

Returns:
  • The algebraic immunity of the Boolean function.

Examples:

>>> from algebraic_immunity import AlgebraicImmunity
>>> AlgebraicImmunity.ai([0, 1, 1, 0], 2)

restricted_ai(truth_table, restriction_domain, n) staticmethod

Compute the restricted algebraic immunity of a Boolean function.

Parameters:
  • truth_table

    Truth table of the Boolean function. Each entry must be either 0 or 1.

  • restriction_domain

    Subset of truth-table indices on which to compute the restricted algebraic immunity.

  • n

    Number of variables of the Boolean function.

Returns:
  • The algebraic immunity of the restricted Boolean function.

Examples:

>>> from algebraic_immunity import AlgebraicImmunity
>>> AlgebraicImmunity.restricted_ai([0, 1, 1, 0], [0, 1], 2)

Boolean funcrion object.

__doc__ = 'Boolean funcrion object.' class-attribute

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__module__ = 'algebraic_immunity.algebraic_immunity' class-attribute

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__new__(*args, **kwargs) builtin

Create and return a new object. See help(type) for accurate signature.

algebraic_immunity() method descriptor

Compute the algebraic immunity of the Boolean function.

Returns:
  • The algebraic immunity of the Boolean function.

Examples:

>>> from algebraic_immunity import BooleanFunction
>>> bf = BooleanFunction([0, 1, 1, 0])
>>> bf.algebraic_immunity()

restricted_algebraic_immunity(restriction_domain) method descriptor

Compute the restricted algebraic immunity of the Boolean function.

Parameters:
  • restriction_domain

    Subset of input indices on which to restrict the Boolean function.

Returns:
  • The algebraic immunity of the restricted Boolean function.

Examples:

>>> from algebraic_immunity import BooleanFunction
>>> bf = BooleanFunction([0, 1, 1, 0])
>>> bf.restricted_algebraic_immunity([0,2])