A method for executing a requested operation by a circuit (CT, CT1), the method comprising: generating an input mask set (U) comprising input mask parameters (U[l]); generating an input set (PX, PX1) comprising data resulting from the combination of an input data (X) of the requested operation with each input mask parameter of the input mask set by Exclusive OR, XOR, operations (⊕); and providing as an output of the requested operation an output set (PR) comprising data resulting from the application of the requested operation to each data in the input set, wherein the requested operation is a bit permutation operation (OPR, PEXP, EXP, RPM) whereby bits of the input data (X) are mixed to obtain an output data comprising at least two words, the input mask set comprising one word column (Ui) per word of the input data, each word column of the input mask set comprising a same number of occurrences of all possible values of one input data word in relation to a size of the input data words, each data in the output set corresponding with a respective input mask parameter of the input mask set and being equal to a corresponding output mask parameter belonging to an output mask set, combined by XOR operations with an output data resulting from the application of the requested operation to the input data, each output mask parameter being equal to the application of the requested operation to the corresponding input mask parameter, the input mask set being generated to fulfill the condition that the output mask set comprises columns of output mask words, each output mask word column comprising a same number of occurrences of all possible values of the output mask words in relation to a size of the output mask words, the condition being fulfilled when each of the words of each mask parameter in the output mask set comprises less than twice a same bit rank from the words of one word column of the input mask set. generating an input mask set (U) comprising input mask parameters (U[l]); generating an input set (PX, PX1) comprising data resulting from the combination of an input data (X) of the requested operation with each input mask parameter of the input mask set by Exclusive OR, XOR, operations (⊕); and providing as an output of the requested operation an output set (PR) comprising data resulting from the application of the requested operation to each data in the input set, wherein the requested operation is a bit permutation operation (OPR, PEXP, EXP, RPM) whereby bits of the input data (X) are mixed to obtain an output data comprising at least two words, the input mask set comprising one word column (Ui) per word of the input data, each word column of the input mask set comprising a same number of occurrences of all possible values of one input data word in relation to a size of the input data words, each data in the output set corresponding with a respective input mask parameter of the input mask set and being equal to a corresponding output mask parameter belonging to an output mask set, combined by XOR operations with an output data resulting from the application of the requested operation to the input data, each output mask parameter being equal to the application of the requested operation to the corresponding input mask parameter, the input mask set being generated to fulfill the condition that the output mask set comprises columns of output mask words, each output mask word column comprising a same number of occurrences of all possible values of the output mask words in relation to a size of the output mask words, the condition being fulfilled when each of the words of each mask parameter in the output mask set comprises less than twice a same bit rank from the words of one word column of the input mask set. <EOS>