2
$\begingroup$

I want to read this kind of diagram, but I haven't found the name of this, or somewhere I can find a legend of symbols used, or a tutorial to learn reading this...

I've googled this for over an hour, with similar images. Nothing :/

1st diagram

2nd

$\endgroup$
4
  • $\begingroup$ $\boxplus$ is modulo addition, $\oplus$ is the x-or, and $\lll$ is left rotate... If your read the papers, they mention those... $\endgroup$
    – kelalaka
    Jun 13, 2022 at 20:51
  • $\begingroup$ Depending on whether you look at a mathematical representation or pure computer code, $\land$ is either AND or XOR (C/C++/Java etc.). $\endgroup$
    – Paul Uszak
    Jun 14, 2022 at 0:36
  • 1
    $\begingroup$ @PaulUszak $\land$ and ^ are different. The former exclusively means AND. If you're using ASCII, then you'd want to use & for AND, | for OR, and ^ for XOR. If using logical symbols, you can use $\land$, $\lor$, and $\oplus$. $\endgroup$
    – forest
    Jun 14, 2022 at 0:39
  • $\begingroup$ @forest Well done. $\endgroup$
    – Paul Uszak
    Jun 14, 2022 at 0:40

1 Answer 1

3
$\begingroup$

These are fairly standard. $\boxplus$ is modular addition, $\oplus$ is XOR, $\lll$ is left rotate, and $\ll$ is left shift. Others you may see include $\land$ (logical AND) and $\lor$ (logical OR), as well as $\otimes$ (meanings differ).

For example, the second image you posted is the half round function of RC5. It is read as:

\begin{align} A &= ((A \oplus B) \lll B) + S_{2i} \\ B &= ((B \oplus A) \lll A) + S_{2i+1} \end{align}

Note that $S_{2i}$ and $S_{2i+1}$ are not labeled (they just come in at the left in your diagram and are indices into state array $S$), and the top left and right inputs and bottom left and right outputs are $A$ and $B$.


I ran the reference implementation for RC5-32/12/16 with a null key. In the first round:

\begin{align} A &= ((\texttt{0x9BBBD8C8} \oplus \texttt{0x1A37F7FB} \lll \texttt{0x1A37F7FB}) + \texttt{0x46F8E8C5}\\ B &= ((\texttt{0x1A37F7FB} \oplus \texttt{0x9BBBD8C8} \lll \texttt{0xE3054A3E}) + \texttt{0x460C6085} \end{align}

This results in $\texttt{0xE3054A3E}$ for $A$ and $\texttt{0xC4590FF6}$ for $B$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.