Abstract:
A combination of an infrequently-called tiny multiplication unit and a “differential” unit that quickly computes T         (n+1) basing on known T

Description:
FIELD 
     This invention relates to the field of data storage. More particularly, this invention relates to maintaining the security of data at rest. 
     BACKGROUND 
     “Data at rest” is the name that is commonly used for stored data, such as that residing on large hard drive or tape drive systems. Data at rest describes such data as it is disposed, for example, in large scale commercial data storage systems, such as might be used for credit card data and medical records. The security of data at rest is becoming an increasingly important topic as vast amounts of an individual&#39;s sensitive information are digitized and stored. 
     Several different methods and standards for protecting the confidentiality of such data have been developed and utilized. The Institute of Electrical and Electronics Engineers, Inc. has organized an effort to develop additional security measures for data at rest. This project is refining an advanced encryption standard that was originally developed by Liskov, Rivest, and Wagner, and is variously referred to as LRW-AES, AES-LRW, P1619, or tweakable narrow block encryption. 
     Such methods are developed to prevent malicious and unauthorized access to data, such as copy-and-paste attacks and dictionary attacks. These methods are based on standard AES, where both input and output of an AES encryptor/decryptor are XORed with vectors computed from a tweakable key and a data block&#39;s serial number (so-called whitening vectors). Compact and fast computation of whitening vectors is critical for numerous applications. 
     Let M and T be a so-called master key (128, 192, or 256 bits, depending on the implementation) and a tweakable key (128 bits) respectively, let D be a 128-bit data block, and let n be its serial number (address), also represented as a 128-bit number; then the 128-bit result R of LRW-AES encoding of data D can be expressed by the formula R=(T           n)⊕AES((T         n)⊕D, M), where AES(b, k) denotes the encoding operation of the cipher AES for data block b and key k,           is multiplication in the Galois field GF(2 128 ) and ⊕ is addition in the same field (defined identically as bitwise XOR). This is depicted graphically in  FIG. 1 .
     Decoding is a similar process. It can be expressed by the formula D=(T           n)⊕AES −1 ((T         n)⊕R, M), where AES −1 (b, k) denotes the decoding operation of the cipher AES for the encoded data block b and key k.
     Typically, thirty-two 128-bit data blocks used in the encoding/decoding process are grouped together to form 512-byte (i.e. 4096-bit) disk blocks, having sequential numbers n=32 m, 32 m+1, . . . , 32 m+31, where m is the address of the disk&#39;s block. 
     There are two main methods for implementing such computations. The first one directly follows the structure shown in  FIG. 1 . It requires a very effective multiplication unit to be used thirty-two times for each block. To achieve good performance, the multiplication must be implemented in unrolled pipelined form. Therefore, it requires tens of thousands of gates. 
     Another approach is based on some pre-computations. Namely, one may pre-compute and store 128-bit values of the form
 
T           (2−1), T         (4−1), T         (8−1), . . . , T         (2 128 −1)  (1)

     Now one can sequentially find any series of products P n =T           n, where n=n 0 , n 0 +1, n 0 +2 etc. using only one actual multiplication for n=n 0 : each next value P n+1 =T         (n+1) can be expressed from the previous one P n =T         n as:
     
       
         
           
               
             
               
                 
                   
                     
                       P 
                       
                         n 
                         + 
                         1 
                       
                     
                     = 
                       
                     ⁢ 
                     
                       
                         P 
                         n 
                       
                       ⊕ 
                       
                         ( 
                         
                           
                             P 
                             
                               n 
                               + 
                               1 
                             
                           
                           ⊕ 
                           
                             P 
                             n 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   
                     = 
                       
                     ⁢ 
                     
                       
                         P 
                         n 
                       
                       ⊕ 
                       
                         ( 
                         
                           
                             T 
                             ⁢ 
                             ⁢ 
                             
                               ( 
                               
                                 n 
                                 + 
                                 1 
                               
                               ) 
                             
                           
                           ⊕ 
                           
                             T 
                             ⁢ 
                             ⁢ 
                             n 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   
                     
                       = 
                         
                       ⁢ 
                       
                         
                           P 
                           n 
                         
                         ⊕ 
                         
                           ( 
                           
                             T 
                             ⁢ 
                             ⁢ 
                             
                               ( 
                               
                                 
                                   ( 
                                   
                                     n 
                                     + 
                                     1 
                                   
                                   ) 
                                 
                                 ⊕ 
                                 n 
                               
                               ) 
                             
                           
                           ) 
                         
                       
                     
                     , 
                   
                 
               
             
           
         
       
     
     where (n+1)⊕n has the form 2 m+1 −1, with m equal to the number of trailing 1&#39;s in the binary expansion of n (or, m+1 is equal to the number of trailing 0&#39;s in the binary expansion of n+1). For example,
 
1⊕0=1 2 ⊕0 2 =1 2 =1=2 1 −1 (zero trailing 1&#39;s in 0=0 2 )
 
2⊕1=10 2 ⊕1 2 =11 2 =3=2 2 −1 (one trailing 1&#39;s in 1=1 2 )
 
3⊕2=11 2 ⊕+10 2 =1 2 =1=2 1 −1 (zero trailing 1&#39;s in 2=10 2 )
 
4⊕3=100 2 ⊕11 2 =111 2 =7=2 3 −1 (two trailing 1&#39;s in 3=11 2 )
 
5⊕4=101 2 ⊕100 2 =1 2 =1=2 1 −1 (zero trailing 1&#39;s in 4=100 2 )
 
6⊕5=110 2 ⊕101 2 =11 2 =3=2 2 −1 (one trailing 1&#39;s in 5=101 2 )
 
7⊕6=111 2 ⊕110 2 =1 2 =1=2 1 −1 (zero trailing 1&#39;s in 6=110 2 )
 
8⊕7=1000 2 ⊕111 2 =1111 2 =15=2 4 −1 (three trailing 1&#39;s in 7=111 2 )
 
9⊕8=1001 2 ⊕1000 2 =1 2 =1=2 1 −1 (zero trailing 1&#39;s in 8=1000 2 ), etc.
 
     Thus, the product T           ((n+1)⊕n) is one of our stored pre-computed values, and it is sufficient just to add (XOR) it to P n  to produce P n+1 . This method is efficient in terms of performance but requires a lot of memory.
     The amount of required memory can be reduced if one may process 128-bit data blocks in a non-standard order. For example, usage of so-called Gray code (i.e. reordering number sequence in such a way that any two neighboring numbers have distinction in only one bit, like 0-1-3-2-6-7-5-4, i.e. binary 000-001-011-010-110-111-101-100) reduces the number of required pre-computed values from 128 to 7. But this kind of reordering may require changing the data transfer protocols, interfaces etc., or adding extra buffering, i.e. this method is not a universal solution. 
     Thus, additional implementations of the LRW-AES are needed, such as do not rely on expensive pipelined multipliers or extra random access memory, but still process data in natural order. While there are multiple existing implementations of LRW-AES, it is desirable to achieve a combination of compactness and maximum speed. 
     SUMMARY 
     The above and other needs are met by a combination of an infrequently-called tiny multiplication unit and a “differential” unit that quickly computes T           (n+1) based on known values of T         n. The schedule (how often the multiplication unit is called) can be considered as a parameter of the algorithm. The proposed architecture of the “differential” unit is efficient both in terms of speed (delay) and area (gate count).
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       Further advantages of the invention are apparent by reference to the detailed description when considered in conjunction with the figures, which are not to scale so as to more clearly show the details, wherein like reference numbers indicate like elements throughout the several views, and wherein: 
         FIG. 1  depicts a functional block diagram of a general scheme of LRW-AES, where the address and tweakable key are multiplied in the Galois field GF(2 128 ) to produce the whitening vector which is XORed on both the inputs and the outputs of the AES unit. 
         FIG. 2  depicts a logical structure of a computational scheme according to the present invention, where all connections in the figure except those between units C and D represent 128-bit busses. 
         FIG. 3  depicts an embodiment of unit A as depicted in  FIG. 2 . 
         FIG. 4  depicts an embodiment of an internal sub-module “           2” to be used in unit B, depicted in  FIG. 2 .
         FIG. 5  depicts a representative embodiment of unit C as depicted in  FIG. 2 . 
         FIG. 6  depicts an embodiment of units B and D as depicted in  FIG. 2 . 
         FIG. 7  depicts an additional embodiment including the circuitry of  FIG. 2 . 
         FIG. 8  depicts a sample timed data flow diagram of computations according to one embodiment of the present invention (for the extreme case when actual multiplication is executed only once in the very beginning of the data sequence), as depicted in  FIG. 2 . 
         FIG. 9  depicts a sample timed data flow diagram of computations according to another embodiment of the present invention (for the case when actual multiplication is executed for each second portion of input data), as depicted in  FIG. 2 . 
         FIG. 10  depicts a sample timed data flow diagram of computations according to yet another embodiment of the present invention (for the case when actual multiplication is executed for each fourth portion of input data), as depicted in  FIG. 2 . 
     
    
    
     DETAILED DESCRIPTION 
     A method according to the present invention uses a special expansion instead of precomputed table of solutions to equation (1). The computation scheme is described in the steps below and generally depicted in  FIG. 2 . The computational efficiency of the scheme is based on the fact that the tweakable key T is preferably set once soon after power on and then is not changed, and taking into account the particular representation of the field GF(2 128 ) (generated by the polynomial x 128 +x 7 +x 2 +x+1). In this regard, it is well to note that there exist two interpretations of binary representation of Galois Field elements. If for example, the element of GF(256) is binary encoded as “00100110,” than we refer to it as number 38(0×128+0×64+1×32+0×16+0×8+1×4+1×2+0×1=38), but there exists a polynomial interpretation as x 5 +x 2 +x (or, in more expanded form, 0×x 7 +0×x 6 +1×x 5 +0×x 4 +0×x 3 +1×x 2 +1×x+0×1). 
     The present method also makes use of the fact that 128-bit data blocks typically used in the encoding/decoding process are grouped together to form 512-byte disk blocks, having sequential numbers n=32 m, 32 m+1, . . . , 32 m+31, where m is the address of the disk&#39;s block, and the typical LRW-AES scenario includes infrequent positioning to random address locations, and then a long contiguous sequence of incrementing the addresses by one. 
     Thus, one can optimize the computation of P n+1 =T           (n+1) using the previously computed P n =T         n. The method according to the present invention is based on the following two expansions:
     
       
         
           
               
             
               
                 
                   
                     
                       
                         
                           
                             P 
                             
                               n 
                               + 
                               1 
                             
                           
                           = 
                           
                             
                               P 
                               n 
                             
                             ⊕ 
                             
                               ( 
                               
                                 
                                   P 
                                   
                                     n 
                                     + 
                                     1 
                                   
                                 
                                 ⊕ 
                                 
                                   P 
                                   n 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                           = 
                           
                             
                               P 
                               n 
                             
                             ⊕ 
                             
                               ( 
                               
                                 
                                   T 
                                   ⁢ 
                                   ⁢ 
                                   
                                     ( 
                                     
                                       n 
                                       + 
                                       1 
                                     
                                     ) 
                                   
                                 
                                 ⊕ 
                                 
                                   T 
                                   ⁢ 
                                   ⁢ 
                                   n 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                           = 
                           
                             
                               P 
                               n 
                             
                             ⊕ 
                             
                               ( 
                               
                                 T 
                                 ⁢ 
                                 ⁢ 
                                 
                                   ( 
                                   
                                     
                                       ( 
                                       
                                         n 
                                         + 
                                         1 
                                       
                                       ) 
                                     
                                     ⊕ 
                                     n 
                                   
                                   ) 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                 
                 
                   
                     ( 
                     2 
                     ) 
                   
                 
               
             
           
         
       
     
     and 
     
       
         
           
               
             
               
                 
                   
                     
                       
                         
                           
                             T 
                             ⁢ 
                             ⁢ 
                             
                               ( 
                               
                                 
                                   2 
                                   ⁢ 
                                   m 
                                 
                                 - 
                                 1 
                               
                               ) 
                             
                           
                           = 
                           
                             
                               ( 
                               
                                 T 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 Ø 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 3 
                               
                               ) 
                             
                             ⁢ 
                             ⁢ 
                             
                               ( 
                               
                                 3 
                                 ⁢ 
                                 ⁢ 
                                 
                                   ( 
                                   
                                     
                                       2 
                                       m 
                                     
                                     - 
                                     1 
                                   
                                   ) 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                           = 
                           
                             
                               ( 
                               
                                 T 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 Ø 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 3 
                               
                               ) 
                             
                             ⁢ 
                             ⁢ 
                             
                               ( 
                               
                                 
                                   2 
                                   
                                     m 
                                     + 
                                     
                                         
                                     
                                     ⁢ 
                                     1 
                                   
                                 
                                 + 
                                 1 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                           = 
                           
                             
                               ( 
                               
                                 T 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 Ø 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 3 
                               
                               ) 
                             
                             ⁢ 
                             ⁢ 
                             
                               ( 
                               
                                 
                                   2 
                                   
                                     m 
                                     + 
                                     1 
                                   
                                 
                                 ⊕ 
                                 1 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             = 
                             
                               
                                 [ 
                                 
                                   
                                     ( 
                                     
                                       T 
                                       ⁢ 
                                       
                                           
                                       
                                       ⁢ 
                                       Ø 
                                       ⁢ 
                                       
                                           
                                       
                                       ⁢ 
                                       3 
                                     
                                     ) 
                                   
                                   ⁢ 
                                   ⁢ 
                                   
                                     2 
                                     
                                       m 
                                       + 
                                       1 
                                     
                                   
                                 
                                 ] 
                               
                               ⊕ 
                               
                                 ( 
                                 
                                   T 
                                   ⁢ 
                                   
                                       
                                   
                                   ⁢ 
                                   Ø 
                                   ⁢ 
                                   
                                       
                                   
                                   ⁢ 
                                   3 
                                 
                                 ) 
                               
                             
                           
                           , 
                         
                       
                     
                   
                 
                 
                   
                     ( 
                     3 
                     ) 
                   
                 
               
             
           
         
       
     
     where Ø denotes division in the field GF(2 128 ), and 
     
       
         
           
               
             
               
                 
                   
                     m 
                     = 
                     
                       m 
                       ⁡ 
                       
                         ( 
                         n 
                         ) 
                       
                     
                   
                 
               
               
                 
                   
                     = 
                     
                       1 
                       + 
                       
                         ( 
                         
                           number 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           of 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           trailing 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             1 
                             &#39; 
                           
                           ⁢ 
                           s 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           in 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           the 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           binary 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           expansion 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           of 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           n 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   
                     = 
                     
                       
                         ( 
                         
                           
                             number 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             of 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             trailing 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             
                               0 
                               &#39; 
                             
                             ⁢ 
                             s 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             in 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             the 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             binary 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             expansion 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             of 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             n 
                           
                           + 
                           1 
                         
                         ) 
                       
                       . 
                     
                   
                 
               
             
           
         
       
     
     This definition of m(n) is selected such that 2 (m(n)− 1)−1=(n+1)⊕n. 
     The scheme of computation of T           (2 m(n) −1), given inputs T and n, is described in the steps below and depicted in  FIG. 2 .
     Step A. Pre-compute the 128-bit value:
 
T 0 =TØ3.
 
     This can be done using just 133 XOR gates.  FIG. 3  depicts one circuit structure for accomplishing this. Adding a few more gates, one can optimize the circuit for depth if desired, namely, the upper row of XORs as depicted can be reorganized into a tree-based structure with a depth as low as about seven XOR gates. 
     Step B. Pre-compute 128 128-bit values (each of which requires only three XORs):
 
T 1 =T 0             2,
 
T 2 =T 1           2,
 
T 128 =T 127           2.

     Note that these steps are written as if they were sequential, but the actual netlist behind them has a small depth. This depth also, if desired, can be reduced by reorganizing chains of XOR gates into trees. 
     Note also that (TØ3)           (2 m+1 ⊕1)= T   m+1 ⊕T 0 . That is, now we have to select the pre-computed value T m+1  (depending on m). Steps C and D 0 -D 6  perform this selection.
     Step C. Starting with the 128-bit value n, compute the 7-bit value m. This is one of several frequently used operations and can be implemented with a delay of not more than seven levels of MUXes and a number of gates equal to approximately 2.5×128 (0.5×128 MUXes and 2×128 simpler 2-input gates). 
     One embodiment of the circuitry to perform such a computation is depicted in  FIG. 5 . The embodiment of  FIG. 5  is not a final solution for implementation, in that it has unacceptably high delay for such a time-critical module. It is just a sample circuitry with the same functional behavior. In the simple embodiment shown in  FIG. 5 , the hatched layers have a relatively large depth. However, these layers can be re-implemented. These layers correspond to functions of the form a&amp;(b           (c&amp;(d         (e&amp; . . . )))), and these functions for N inputs have circuits with depths of less than 2 log 2 N, and a number of gates that is about 1.5N.
     Step D 0 . Using the least significant bit m 0  in the binary expansion of m, compute sixty-four 128-bit values, by:
 
T 1.0 =m 0 ?T 1 :T 2 ,
 
T 2.0 =m 0 ?T 3 :T 4 ,
 
T 3.0 =m 0 ?T 5 :T 6 ,
 
T 64.0 =m 0 ?T 127 :T 128 .
 
     (The C/C++-like notation of “a?b:c” means “if a, choose b; else choose c”.) 
     Because each next T i  is almost identical to the previous one cyclically shifted one position to the left, we may notice that instead of 64×128 MUXes, the calculation requires a much smaller number of them: 128 for the first result, but only five for each succeeding result, so the total number of MUXes is 128+5×63&lt;3.5×128. 
     Step D 1 . Using the second least significant bit m 1  in the binary expansion of m, compute thirty-two more 128-bit values, by:
 
T 1.1 =m 1 ?T 1.0 :T 2.0,  
 
T 2.1 =m 1 ?T 3.0 :T 4.0,  
 
T 3.1 =m 1 ?T 5.0 :T 6.0,  
 
T 32.1 =m 1 ?T 63.0 :T 64.0.  
 
     Similar to that as described in the previous step, we can estimate the number of MUXes here as 128+9×31&lt;3.25×128. 
     Step D 2 . Using the third least significant bit m 2  in the binary expansion of m, compute sixteen more 128-bit values, by:
 
T 1.2 =m 2 ?T 1.1 :T 2.1,  
 
T 2.2 =m 2 ?T 3.1 :T 4.1,  
 
T 3.2 =m 2 ?T 5.1 :T 6.1,  
 
T 16.2 =m 2 ?T 31.1 :T 32.1.  
 
     Similarly to that as described in the previous steps, we can estimate the number of MUXes here as 128+14×15&lt;2.75×128. 
     Steps D 3 , D 4 , D 5  are for further computations to reduce the number of values to eight, then four, then two 128-bit values, similar to that as described above in steps D 0  through D 2  using bits m 3 , m 4 , and m 5 , respectively. Finally, Step D 6  computes a single 128-bit value, by:
 
T 1.6 =m 6 ?T 1.5 :T 2.5  
 
     The number of MUXes used in steps D 3  through D 6  can be estimated as (128+22×7)+(128+38×3)+(128+70×1)+128&lt;7×128, which makes a total of 16.5×128 MUXes for all of the steps D 0  through D 6 . Note that T 1.6  is the same as our desired T m+1 . That is, we have to perform the very last step. 
     Step E. Compute:
 
T m+1 ⊕T 0 .
 
     This step requires just 128 XOR gates. 
     The timing-critical part of the entire computation (i.e. steps C through D 0  . . . D 6  through E, because the tweakable key T can be considered as a constant) is very small: about fifteen levels of MUXes, or one to two clock cycles for a typical implementation. The number of gates is also moderate: about 3,000 XORs and MUXes (not including control logic, registers to store the tweakable key T and the last value of P, and the “slow” multiplication module used in the beginning of each 512-byte block). 
     The output of unit E is used to compute P n+1  given n, T, and P n . These three values are stored somewhere, such as in registers R n , R T , and R P , and the circuit in  FIG. 2 , with 128 extra XOR gates, computes a new value to be downloaded back into R P , as depicted in  FIG. 7 . 
     The circuitry of  FIG. 2  is used to transform a data block D in the following manner. Formally, the block D has 128×128 inputs. But actually, each next 128-bit group of inputs has only three new values, and the remaining 125 are just copies from the previous one, shifted one position to the left (see  FIG. 4 ). For example, if the first, second, third, and fourth 128-bit group of inputs (T 1  . . . T 4  in  FIGS. 2 and 6 ) are, respectively:
 
a[127]a[126] . . . a[0]
 
b[127]b[126] . . . b[0]
 
c[127]c[126] . . . c[0]
 
d[127]d[126] . . . d[0]
 
then
 
 b[i]=a[i− 1 mod 128](excepting  i= 1,2,7);
 
 c[i]=b[i− 1 mod 128](excepting  i= 1,2,7);
 
 d[i]=c[i− 1 mod 128](excepting  i= 1,2,7).
 
     Then, the top-left MUX in Unit D (see  FIG. 6 ) selects between a and b:
 
 x[i ]=if( m   0 ) then  b[i ] else  a[i] 
 
     the MUX just under it selects between c and d:
 
 y[i] =if( m   0 ) then  d[i ] else  c[i].  
 
     Due to relationships between a, b, c, and d, most of y[i] are the same as x[i−2 mod 128]:
 
y[0]=x[126]
 
y[1] has a new value
 
y[2] has a new value
 
y[3] has a new value
 
y[4]=x[2]
 
y[5]=x[3]
 
y[6]=x[4]
 
y[7] has a new value
 
y[8] has a new value
 
y[9]=x[7]
 
y[10]=x[8]
 
y[127]=x[125]
 
     In other words, the computation of all 128 y[i] values actually requires only five gates. This is why the second MUX (the one that produces T 2,0  in  FIG. 6 ) is displayed with a lighter weight outline—it (and the other MUXs with lighter line weight) can be considered to be a “lighter weight” MUX. In the same way, all the other MUXes behave similarly: for each column, only the first MUX contains all 128 elementary one bit MUXes, whereas all MUXes below it are much simpler. The estimation shows that the whole set of MUXes for N×N inputs (in our case, N=128) contains not about N×N gates (as would happen if all N×N inputs are distinct), but only about const×N, where const is a moderate constant that is less than N. 
     Further Improvements 
     By adding a few gates, we can improve the timing in the computation. For example, we can use the fact that, if n is even, then the value of T{circle around (×)}((n+1)⊕n) is just T; thus for even n&#39;s we can produce the result immediately and start to prepare the computation for n+1, i.e. we get one extra clock cycle for free, as depicted in  FIGS. 8-9 . 
     In  FIGS. 8-10 , dotted lines represent propagation and modification of auxiliary information (address (index) and whitening vector), solid lines represent actual data under transformation, and thick lines, whether solid or dotted, represent computations. 
     In  FIG. 8 , transformations marked “Δ” require one clock cycle, and include computing the differential D T (n)=T           ((n+1)⊕n), updating the whitening vector P n+1 =P n ⊕D T (n), and updating the index n=n+1.
     In  FIG. 9 , the transformations “Δ1” and “Δ2” may be applied only to even values of n. “Δ2” is similar to “Δ” in  FIG. 8  with n+2 instead of n+1, but can use two clock cycles instead of one. The transformation of “Δ1” (identical to “Δ” in  FIG. 8 ) must be fast (one clock cycle long), but due to the fact that n is even, the principal part of the computation, D T (n)=           ((n+1)⊕n), actually means that D T (n)=T.
     Alternately, we can separately find values T           ((n+1)⊕n) for n=0, 1, 2 (mod  4 ): they are just T, T         3, T respectively; and only the computation for n=3 (mod  4 ) requires a general procedure. That is, starting with n=0 (mod  4 ) we can initiate the computing for n+3, that gives us three extra clock cycles for free, as depicted in  FIG. 10 . The further generalization is also clear and may be useful. In  FIG. 10 , n may be chosen of the form 4k. The transformation “Δ4” is similar to “Δ” in  FIG. 8 , with n+4 instead of n+1, but can use four clock cycles instead of one. The transformation “Δ1” is the same as in  FIG. 9 . The transformation Δ1′ is another one-clock cycle variant of “Δ” in  FIG. 8 , but applied to n of the form 4k+1. Due to this fact, in the transformation Δ1′ the computation of D T (n)=T         ((n+1)⊕n) is reduced to a quite simple D T (n)=T         3.
     In a similar way, as a generalization of the two methods described above, we can separately find values T           ((n+1)⊕n) for n=0, 1, . . . , K−2 (mod K), where K=2 k , and only the computation for n=K−1 (mod K) requires a general procedure. Among the first K−1 values there are only k different ones, namely, T=T         (2−1), T         3=T         (4−1), T         7=T         (8−1), . . . , T         (K−1).
     Note that the four-clock cycle computation “Δ4” in  FIG. 10  (or a similar block “ΔK” in the general case) may now be implemented not only in a differential way, but also using direct multiplication of the form P n =T           n, possibly sharing the same multiplication unit as the one used for the initial multiplication.
     It may also be efficient in certain situations to use two copies of some or all of these units: the first one computes values to be XORed with the input data prior to the input of the AES, and the second one repeats the calculation, after some delay that depends on the AES implementation (ten to twenty clock cycles, for example), with the output of this second block to be XORed with the output of the AES. This might supersede one set of computation blocks, whose outputs are stored in some memory or passed through the pipeline just to make synchronization with the output of the AES. 
     CONCLUSION 
     The above describes a novel method of encrypting data, where an appropriate differential value D=T           ((n+1)⊕n) is calculated on the fly as encryption is performed. This either reduces the memory or the computational capacity (or both) that is required by other methods. The method is accomplished in the following five steps:
   Step A Pre-compute the 128-bit value T 0  (which can be done using just 130-150 XOR gates);   Step B Pre-compute 128 128-bit values (each of them requires only three XORs):
 
T 1 =T 0           2, T 2 =T 1           2, . . . , T 128 =T 127           2.
   Step C The value m is computed as the number of trailing ones in the binary expansion of n.   Step D Perform the selection of value T m+1  (depending on m). Due to small and regular differences (depending on irreducible polynomial generating Galois field), this selection can be done with a great reduction in the number of MUXes.   Step E Compute the differential D=T m+1 ⊕T 0 .   

     The foregoing description of preferred embodiments for this invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Obvious modifications or variations are possible in light of the above teachings. The embodiments are chosen and described in an effort to provide the best illustrations of the principles of the invention and its practical application, and to thereby enable one of ordinary skill in the art to utilize the invention in various embodiments and with various modifications as are suited to the particular use contemplated. All such modifications and variations are within the scope of the invention as determined by the appended claims when interpreted in accordance with the breadth to which they are fairly, legally, and equitably entitled.