forked from I2P_Developers/i2p.i2p

Adapted from https://github.com/rweather/noise-java/pull/18 Section 5.1 of the The Noise Protocol Framework, revision 34 states in the description for DecryptWithAd that: If an authentication failure occurs in DECRYPT() then n is not incremented and an error is signaled to the caller. But noise-java currently increments the nonce unconditionally. This change defers incrementing the nonce until encryption/decryption operations actually succeed.