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 :

$\displaystyle u = 1 \bmod n $(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:

$\displaystyle u = 1 \bmod n$

$\displaystyle u - 1 = qn $

$\displaystyle u - qn= 1$

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