Input: =
Output:
(1) Select a random ;
;
;
(2) HBF ;
(3) For from 0 downto
If
   ( ) =
(4) Construct a pre-computation table
;
= ; = ;
(5) For from downto 0 do
(5.1) ;
(5.2) ;
(6) Return .
Algorithm 5: Zhang, Chen, Xiao's algorithm.