[warn] Invalid result from curve25519 handshake: 4

I get this on the moriatoo relay, which is running git master and is also hooked up to a bwauth.

The messages around it are:

Sep 04 03:21:11.000 [warn] Invalid result from curve25519 handshake: 4
Sep 04 03:21:11.000 [warn] onion_skin_client_handshake failed.
Sep 04 03:21:11.000 [warn] circuit_finish_handshake failed.

It actually happens not infrequently, so it's not just a one-off thing.

The code is

  if (bad) {
    log_warn(LD_PROTOCOL, "Invalid result from curve25519 handshake: %d", bad);
  }

and I think 4 shows up when

  bad |= (tor_memneq(s.auth, auth_candidate, DIGEST256_LEN) << 2);

So I guess the first issue is that "4" is really not a helpful error message for me.

The second issue is to wonder what's gone wrong and whether there's a deeper bug.