Skip to content

Commit

Permalink
Add inversion function for sage.crypto.sboxes
Browse files Browse the repository at this point in the history
Add inversion mapping in GF(2^n) extending 0 -> 0. Such mapping is used for instance in the AES S-Box.
  • Loading branch information
rusydi authored Jan 10, 2025
1 parent 1be0a58 commit 4cce1f5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/sage/crypto/sboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,27 @@ def monomial_function(n, e):
return SBox(X**e)


def inversion(n):
r"""
Return the S-Box constructed from the inversion mapping over `\GF{2^n}` extending `0 \mapsto 0`
INPUT:
- ``n`` -- size of the S-Box (i.e. the degree of the finite field extension)
EXAMPLES::
sage: from sage.crypto.sboxes import inversion
sage: S4 = inversion(4)
sage: S4.differential_uniformity()
4
sage: S5 = inversion(5)
sage: S5.differential_uniformity()
2
"""
return monomial_function(n, 2**n - 2)


# Bijective S-Boxes mapping 9 bits to 9
# =====================================

Expand Down

0 comments on commit 4cce1f5

Please sign in to comment.