comment incorrect now?  Adds 1 if they do not match, does not add 0 if they do.
Maybe:
  nResult += (length == length ? 1 : 2)
... and
  return nResult == 1;
... to get really-and-truly-ought-to-be-constant-time...

Also, commits need to be squashed into one.

Also style nitpick, space after for/if:  for (size_t ...)  and if (strUser...)