Skip to content

Example in README fails #3

@mkoeppe

Description

@mkoeppe
Python 3.14.0 (main, Oct  7 2025, 09:34:52) [Clang 17.0.0 (clang-1700.3.19.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sboxanalyzer import *  
... from sage.crypto.sboxes import GIFT as sb
... sa = SboxAnalyzer(sb)                             
... cnf, milp = sa.minimized_diff_constraints()
... 
Number of constraints: 49
Input: a0||a1||a2||a3; msb: a0
Output: b0||b1||b2||b3; msb: b0
Weight: 3.0000 p0 + 2.0000 p1 + 1.4150 p2
Traceback (most recent call last):
  File "<python-input-0>", line 4, in <module>
    cnf, milp = sa.minimized_diff_constraints()
    ^^^^^^^^^
ValueError: too many values to unpack (expected 2, got 3)

Also, are there automatic tests for this package? pytest is declared as an optional dependency, but

 pytest                                                                                                                                                                                               git:main
=============================================================================================================== test session starts ================================================================================================================
platform darwin -- Python 3.14.0, pytest-8.4.2, pluggy-1.6.0
rootdir: /Users/mkoeppe/s/sage/passagemath-pkg-sboxanalyzer
configfile: pyproject.toml
collected 0 items                                                                                                                                                                                                                                  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions