Current section
Files
Jump to
Current section
Files
assets/feistel-diagram.dot
digraph feistel {
rankdir=TB;
node [shape=box, style=filled, fontname="Arial", fontsize=11, margin=0.15, height=0.4];
edge [arrowsize=0.7];
// Input
input [label="Input: N bits", fillcolor="#e1f5ff", shape=ellipse];
// Split
subgraph cluster_0 {
label="Split";
style=rounded;
color="#999999";
margin=12;
L0 [label="L₀\n(Left)", fillcolor="#ffe1e1"];
R0 [label="R₀\n(Right)", fillcolor="#e1ffe1"];
{rank=same; L0; R0;}
}
// Round 1
subgraph cluster_1 {
label="Round 1";
style=rounded;
color="#999999";
margin=12;
L1 [label="L₁", fillcolor="#ffe1e1"];
F1 [label="F(R₀)", fillcolor="#fff4e1"];
XOR1 [label="⊕", fillcolor="white", shape=circle, width=0.4, fixedsize=true];
R1 [label="R₁", fillcolor="#e1ffe1"];
{rank=same; L1; F1; XOR1; R1;}
}
// Round 2
subgraph cluster_2 {
label="Round 2";
style=rounded;
color="#999999";
margin=12;
L2 [label="L₂", fillcolor="#ffe1e1"];
F2 [label="F(R₁)", fillcolor="#fff4e1"];
XOR2 [label="⊕", fillcolor="white", shape=circle, width=0.4, fixedsize=true];
R2 [label="R₂", fillcolor="#e1ffe1"];
{rank=same; L2; F2; XOR2; R2;}
}
// Round 3
subgraph cluster_3 {
label="Round 3";
style=rounded;
color="#999999";
margin=12;
L3 [label="L₃", fillcolor="#ffe1e1"];
F3 [label="F(R₂)", fillcolor="#fff4e1"];
XOR3 [label="⊕", fillcolor="white", shape=circle, width=0.4, fixedsize=true];
R3 [label="R₃", fillcolor="#e1ffe1"];
{rank=same; L3; F3; XOR3; R3;}
}
// Round 4
subgraph cluster_4 {
label="Round 4";
style=rounded;
color="#999999";
margin=12;
L4 [label="L₄", fillcolor="#ffe1e1"];
F4 [label="F(R₃)", fillcolor="#fff4e1"];
XOR4 [label="⊕", fillcolor="white", shape=circle, width=0.4, fixedsize=true];
R4 [label="R₄", fillcolor="#e1ffe1"];
{rank=same; L4; F4; XOR4; R4;}
}
// Swap
subgraph cluster_5 {
label="Swap";
style=rounded;
color="#999999";
margin=12;
L5 [label="L₅", fillcolor="#ffe1e1"];
R5 [label="R₅", fillcolor="#e1ffe1"];
{rank=same; L5; R5;}
}
// Output
output [label="Output: N bits", fillcolor="#e1f5ff", shape=ellipse];
// Connections
input -> L0 [weight=2];
input -> R0 [weight=2];
// Round 1
L0 -> XOR1;
R0 -> F1;
R0 -> L1 [style=dashed, label="copy", fontsize=9];
F1 -> XOR1;
XOR1 -> R1;
// Round 2
L1 -> XOR2;
R1 -> F2;
R1 -> L2 [style=dashed, label="copy", fontsize=9];
F2 -> XOR2;
XOR2 -> R2;
// Round 3
L2 -> XOR3;
R2 -> F3;
R2 -> L3 [style=dashed, label="copy", fontsize=9];
F3 -> XOR3;
XOR3 -> R3;
// Round 4
L3 -> XOR4;
R3 -> F4;
R3 -> L4 [style=dashed, label="copy", fontsize=9];
F4 -> XOR4;
XOR4 -> R4;
// Swap
L4 -> R5 [label="swap", fontsize=9];
R4 -> L5 [label="swap", fontsize=9];
L5 -> output [weight=2];
R5 -> output [weight=2];
}