reWZ.WZAES.GetWZKey C# (CSharp) Method

GetWZKey() private static method

private static GetWZKey ( WZVariant version, int length ) : byte[]
version WZVariant
length int
return byte[]
        private static byte[] GetWZKey(WZVariant version, int length)
        {
            length = (length & ~15) + ((length & 15) > 0 ? 16 : 0);
            switch ((int) version) {
                case 0:
                    return GenerateKey(KMSIV, AESKey, length);
                case 1:
                    return GenerateKey(GMSIV, AESKey, length);
                case 2:
                    return new byte[length];
                default:
                    throw new ArgumentException("Invalid WZ variant passed.", nameof(version));
            }
        }