A method of performing numerical computations in a cryptographic system, which includes a mathematical system comprising at least one function, the method comprising the steps of:
- expressing the mathematical system in discrete terms,
- expressing at least one variable of the mathematical system as an integer number,
- placing an imaginary decimal separator in said integer number, whereby the integer number represents a real number,
- performing computations including the at least one variable expressed as an integer number so as to obtain a resulting number, the resulting number being expressed as an integer number,
- positioning the imaginary decimal separator in the resulting number at a predetermined position by performing at least one of the steps of:
- correcting the position of the imaginary decimal separator in the integer number, and
- placing an imaginary separator in the resulting number,
- the method further comprising the step of using the resulting number to obtain an output of the cryptographic system.