Org.BouncyCastle.Crypto.Digests.Gost3411Digest.cpyBytesToShort C# (CSharp) Method

cpyBytesToShort() private static method

private static cpyBytesToShort ( byte S, short wS ) : void
S byte
wS short
return void
		private static void cpyBytesToShort(byte[] S, short[] wS)
		{
			for(int i = 0; i < S.Length / 2; i++)
			{
				wS[i] = (short)(((S[i*2+1]<<8)&0xFF00)|(S[i*2]&0xFF));
			}
		}

Usage Example

コード例 #1
0
 private void fw(byte[] input)
 {
     Gost3411Digest.cpyBytesToShort(input, this.wS);
     this.w_S[15] = (this.wS[0] ^ this.wS[1] ^ this.wS[2] ^ this.wS[3] ^ this.wS[12] ^ this.wS[15]);
     Array.Copy(this.wS, 1, this.w_S, 0, 15);
     Gost3411Digest.cpyShortToBytes(this.w_S, input);
 }