scrambler_pkg
Hold S-box, permutation and address-scramble helpers for SRAM data and address scrambling.
Provides the PRESENT 4-bit and Pyjamask 3-bit S-boxes, the PRESENT 32-bit permutation and 6- to 16-bit bit permutations, each with its inverse, 6- to 16-bit rotate-left helpers, and the 6- to 13-bit address scramble functions (key XOR, S-boxes, then permutation).
sbox3
Pyjamask lightweight cipher substitution function
Function returning logic [2:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [2:0] |
ibox3
Pyjamask lightweight cipher inverse substitution function
Function returning logic [2:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [2:0] |
sbox4
PRESENT lightweight cipher substitution function
Function returning logic [3:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [3:0] |
ibox4
PRESENT lightweight cipher inverse substitution function
Function returning logic [3:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [3:0] |
perm32
PRESENT Permutation Layer
Function returning logic [31:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [31:0] |
iperm32
PRESENT Inverse Permutation Layer
Function returning logic [31:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [31:0] |
perm6
Permutation functions
Function returning logic [5:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [5:0] |
perm7
Function returning logic [6:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [6:0] |
perm8
Function returning logic [7:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [7:0] |
perm9
Function returning logic [8:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [8:0] |
perm10
Function returning logic [9:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [9:0] |
perm11
Function returning logic [10:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [10:0] |
perm12
Function returning logic [11:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [11:0] |
perm13
Function returning logic [12:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [12:0] |
perm14
Function returning logic [13:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [13:0] |
perm15
Function returning logic [14:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [14:0] |
perm16
Function returning logic [15:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [15:0] |
rol6
verilator lint_off UNUSEDSIGNAL
Function returning logic [5:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [5:0] | |
r | input | logic [2:0] |
rol7
Function returning logic [6:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [6:0] | |
r | input | logic [2:0] |
rol8
Function returning logic [7:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [7:0] | |
r | input | logic [2:0] |
rol9
Function returning logic [8:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [8:0] | |
r | input | logic [3:0] |
rol10
Function returning logic [9:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [9:0] | |
r | input | logic [3:0] |
rol11
Function returning logic [10:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [10:0] | |
r | input | logic [3:0] |
rol12
Function returning logic [11:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [11:0] | |
r | input | logic [3:0] |
rol13
Function returning logic [12:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [12:0] | |
r | input | logic [3:0] |
rol14
Function returning logic [13:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [13:0] | |
r | input | logic [3:0] |
rol15
Function returning logic [14:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [14:0] | |
r | input | logic [3:0] |
rol16
Function returning logic [15:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [15:0] | |
r | input | logic [3:0] |
iperm6
then ipermN maps input bit j to output bit i.
Function returning logic [5:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [5:0] |
iperm7
Function returning logic [6:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [6:0] |
iperm8
Function returning logic [7:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [7:0] |
iperm9
Function returning logic [8:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [8:0] |
iperm10
Function returning logic [9:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [9:0] |
iperm11
Function returning logic [10:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [10:0] |
iperm12
Function returning logic [11:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [11:0] |
iperm13
Function returning logic [12:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [12:0] |
iperm14
Function returning logic [13:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [13:0] |
iperm15
Function returning logic [14:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [14:0] |
iperm16
Function returning logic [15:0]
| Name | Direction | Type | Description |
|---|---|---|---|
d | input | logic [15:0] |
addr_scramble6
address scramblers: add round key, apply sbox, apply permutation
Function returning logic [5:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [5:0] | |
key | input | logic [5:0] |
addr_scramble7
Function returning logic [6:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [6:0] | |
key | input | logic [6:0] |
addr_scramble8
Function returning logic [7:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [7:0] | |
key | input | logic [7:0] |
addr_scramble9
Function returning logic [8:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [8:0] | |
key | input | logic [8:0] |
addr_scramble10
Function returning logic [9:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [9:0] | |
key | input | logic [9:0] |
addr_scramble11
Function returning logic [10:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [10:0] | |
key | input | logic [10:0] |
addr_scramble12
Function returning logic [11:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [11:0] | |
key | input | logic [11:0] |
addr_scramble13
Function returning logic [12:0]
| Name | Direction | Type | Description |
|---|---|---|---|
addr | input | logic [12:0] | |
key | input | logic [12:0] |