-Internally it caches the nid, so that any subsequent calls can fetch the
-cached value.
-If a matching p and g are not found and the value of parameter q is not set,
-then it is set to q = (p - 1) / 2.
-If parameter q is already set then it must also match the expected q otherwise
-no match will be found.