In the Paillier cryptosystem, one of the stages during the key generation is "Ensure n divides the order of g by checking the existence of the following modular multiplicative inverse: *where function L is defined as " (from wikipedia)

The variable "u" is never defined though, which leads me to my question regarding what this variable is.

The closest thing I've been able to find as an answer to this is in the original document outlining the Paillier cryptosystem where it states :

(http://www.ippari.unict.it/~catalano...3-Paillier.pdf Page 41), however if n>1 (which it is), "u" would always be 1 (which it cannot be according to the function "L" shown previously), and using the Extended Euclidean Algorithm the following would happen:

The variable "n" is known.

Therefore "q" would be equal to 1, and "u" would equal (n+1), which would satisfy the previous relationship, however I do not think that this is correct.

Thanks