View Single Post
Old 2021-03-02, 01:48   #10
charybdis
 
charybdis's Avatar
 
Apr 2020

53×7 Posts
Default

The 2 that's subtracted at each iteration needs to be bit-shifted too. This ensures that the residue at each iteration is just a shifted version of the "correct" residue, but the squarings that are carried out are different, so it's virtually impossible for two tests with different shifts to return the same incorrect result.
charybdis is offline   Reply With Quote