public static ITEA Create(TeaTypes type, TeaKey key)
        {
            switch (type)
            {
            case TeaTypes.TEA:
                return(new TEAFunction(key));

            case TeaTypes.XTEA:
                return(new XTEAFunction(key));

            case TeaTypes.XXTEA:
                return(new XXTEAFunction(key));

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
        public static ITEA Create(TeaTypes type, byte[] pwd)
        {
            switch (type)
            {
            case TeaTypes.TEA:
                return(new TEAFunction(GenerateKey(pwd)));

            case TeaTypes.XTEA:
                return(new XTEAFunction(GenerateKey(pwd)));

            case TeaTypes.XXTEA:
                return(new XXTEAFunction(GenerateKey(pwd)));

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Beispiel #3
0
 public static ITEA Create(TeaTypes type, TeaKey key) => Factory.Create(type, key);
Beispiel #4
0
 public static ITEA Create(TeaTypes type, byte[] pwd) => Factory.Create(type, pwd);
Beispiel #5
0
 public static ITEA Create(TeaTypes type, string pwd, Encoding encoding = null) => Factory.Create(type, pwd, encoding);
Beispiel #6
0
 public static ITEA Create(TeaTypes type) => Factory.Create(type);