When viewing the algorithm, BlowFish found this line:

#define S(x,i) (SBoxes[i][xwbyte##i]) 

What does ## mean?

    2 answers 2

    This is a string connection.

    In this case, the value of the macro parameter is "pasted" to the byte

    Suppose a macro is called with the parameters var and 1 , then

     S(var, 1) 

    will be replaced by the preprocessor on

     (SBoxes[1][var.w.byte1]) 

    and the challenge

     S(var, str) 

    on

     (SBoxes[str][var.w.bytestr]) 

    and so on

      This is token pasting, merging tokens at the preprocessor level.

      For example, S(field,5) (SBoxes[5][field.w.byte5]) to (SBoxes[5][field.w.byte5]) .

      Documentation: