Patent ID: 7072930

Claim:
A method for realizing a binary counter which decrements or increments a partly permuted data word that is stored in a non-volatile memory, is provided with a counter and a working memory, and a data word being stored in the form of at least two memory words in the non-volatile memory, the method comprising: reading the memory words of the data word from the non-volatile memory and storing the memory words in the working memory while performing an inverse reordering of k permutation bits of the data word; applying an inverse bijective mapping function to the k permutation bits of the data word; decrementing or incrementing the data word; applying a bijective mapping function to the k permutation bits of the data word; performing a reordering of the k permutation bits; and checking for each memory word whether it deviates from the memory word stored in the non-volatile memory and storing only those memory words in the non-volatile memory again for which this is the case, in order to increment a data word stored in the non-volatile memory, the bijective mapping function being such that the k least significant bits of the data word, representing the k permutation bits whereto the mapping function is applied, change as infrequently as possible and approximately equally frequently due to the decrementing or incrementing after application of the mapping function, the reordering being performed in such a manner that the k permutation bits of the data word in the working memory are distributed among k memory words in the volatile memory.