1. A method, comprising: calculating, by an electronic circuit, a result of an integral number of applications of an internal composition law to elements of an abelian group and protecting the electronic circuit from attack during the calculating, by: performing iterations of the calculation with different operations based on an even or odd current coefficient of a polynomial representation of said integral number, the degree of which determines the number of iterations; for each iteration having an odd current coefficient, updating a first variable that contains, after all iterations, a final result of the calculation; and for each iteration having an even current coefficient, performing on a second variable an operation that does not modify the value of the second variable, to produce an intermediate result of the iteration, the intermediate result of the iteration being used in the final result of the calculation, wherein a fault injection attack causes the final result of the calculation to be modified independent of whether the current coefficient is even or odd.