Research Article

Automatic Search for the Linear (Hull) Characteristics of ARX Ciphers: Applied to SPECK, SPARX, Chaskey, and CHAM-64

Algorithm 1

Const (): constructing the input-output mask tuples with linear correlation weight of for modular addition, .
Input: and . Each pattern of the Hamming weight distribution of can be calculated by the combination algorithm in [28], which is the combination pattern of , where for .
(1)Func_LSB: //constructing the LSBs of
(2)if then
(3) Output the tuple of () with (1, 1, 1) or (0, 0, 0);
(4)end if
(5)if then
(6) For each , , and , call Func_Middle ();
(7)else
(8) For each , , and , call Func_Middle ();
(9)end if
(10)Func_Middle (): //constructing the middle bits of
(11)if then
(12) call Func_MSB ();
(13)end if
(14)if then
(15)  if then // recorded whether the value of is 1 or not.
(16)   For each and , call Func_Middle ();
(17)  else
(18)   For each and , call Func_Middle ();
(19)  end if
(20)else //. The value of determines whether belongs to or .
(21)if then
(22)   For each and , call Func_Middle ();
(23)  else
(24)   For each and , call Func_Middle ();
(25)  end if
(26)end if
(27)Func_MSB (): //constructing the bits of with position higher than .
(28)if then //the value of determines whether equals to 0 or 7.
(29)  if then
(30)   Let and , call Func_MSB ();
(31)  else
(32)   Let and , call Func_MSB ();
(33)  end if
(34)else //.
(35)  if then
(36)   For each and , output each tuple of ();
(37)  else
(38)   For each and , output each tuple of ();
(39)end if
(40)end if