Patent ID: 8819098

Claim:
A method for calculating, by a processor, a remainder by division of a sequence of bytes interpreted as a first number by a second number, the method comprising: determining the second number, wherein the second number (P) is expressed as P=(2 k −c), where k is less than a bit processing capability of the processor, and c is less than 2 n , where n is given by the formula n=(k−(8b+1)), where b is the number of bytes processed by the processor in each iteration; dividing the sequence of bytes into a first subsequence of bytes and a second subsequence of bytes; calculating a pseudo-remainder by expressing the first subsequence of bytes A*2 (k-8b) +B, wherein the pseudo-remainder is a third number calculated as a sum of A*k and B*2 8b ; combining the second subsequence of bytes and the pseudo-remainder to create a fourth number; and dividing the fourth number by P to generate the remainder, wherein the first number and the fourth number have the same remainder when divided by P.