Org.BouncyCastle.Crypto.Parameters.DesParameters.SetOddParity C# (CSharp) Method

SetOddParity() public static method

public static SetOddParity ( byte bytes ) : void
bytes byte
return void
        public static void SetOddParity(
            byte[] bytes)
        {
            for (int i = 0; i < bytes.Length; i++)
            {
                int b = bytes[i];
                bytes[i] = (byte)((b & 0xfe) |
                                ((((b >> 1) ^
                                (b >> 2) ^
                                (b >> 3) ^
                                (b >> 4) ^
                                (b >> 5) ^
                                (b >> 6) ^
                                (b >> 7)) ^ 0x01) & 0x01));
            }
        }
    }