Created
May 11, 2018 16:49
-
-
Save zihadmahiuddin/682461d20cec28f795697655a0991f75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void IncrementNonce(this byte[] nonce, int timesToIncrease = 2) | |
{ | |
for (int j = 0; j < timesToIncrease; j++) | |
{ | |
ushort c = 1; | |
for (ushort i = 0; i < nonce.Length; i++) | |
{ | |
c += nonce[i]; | |
nonce[i] = (byte)c; | |
c >>= 8; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment