In my implementation, the NN handshake pattern (no static key for initiator or responder) works perfectly fine. However, if I try the XX pattern (or, really, any other pattern), it breaks and gives me an invalid MAC exception. From my debugging so far I've determined that the additional data mismatches with what it should really be, and I can't tell if something is being copied where it shouldn't, or if something isn't being copied where it should be, etc., and comparing against what the Noise protocol spec requires makes it look like what I've done is correct (even though it obviously isn't). Specifically, the failure occurs when the initiator attempts to read the message from the responder. The failure case is in examples/Noise_XX_25519_ChaChaPoly_Blake2b.cpp if anyone does wish to take a look. I use the monocypher crypto library, in monocypher.c/h and monocypher-ed25519.c/h, and I know those aren't the problem because the NN pattern works fine and I imagine if it was the problem those would break either spuriously or all the time. The actual code of the lib is in noise.cpp/h and uses some modern C++20 features.
I hope this isn't a long-shot, but if it is, at least I did ask.
